f181a24a0b
rename() fails under Windows if the destination file/directory exists. I modified the code to only call $this->get_workdir_path() once as that function creates the directory if doesn't exist. And we don't want that considering the behaviour of rename on Windows.