I tested in my system (Windows 10) and works as it is expected . I mean, a file in a folder and then rename works fine but when the oriiginal file is not there I got the error message you mentioned.
Check if the original file exists…(I am unsing go 1.13)
Andre, so good you find the solution but I think it is problem of the go’s version your are using.
I tested with go 1.13 and works as it is documented…
Yamil, that’s strange because I also use 1.13 and I’ve got the error
JPEG_example_down.jpg
originalPath = e:/торренты/JPEG_example_down.jpg
newPath = c:/go/JPEG_example_down.jpg
2019/10/01 19:09:59 rename e:/торренты/JPEG_example_down.jpg c:/go/JPEG_example_down.jpg: The system cannot move the file to a different disk drive.
exit status 1
Yamil, that shoud not be be a problem because go uses unicode internaly so renaming file name will not give us anything, but to be shure I did it and result is the same (it was moving the file in different disk drive (there are no issues with other cases)). Did you realy tried to do the same?
Yamil, did you notice your use cases doesn’t reflect the different disk drive case when you move the file to different disk drive, for example from c:\ to e:\ ? I think you will get an error there too.
I have only one particion.
However I created a virtual drive and the error comes.
So we have two sources of this error (1) With extended charact6er and copy to another foder in the same drive and 2) move to another drive (No matter if filename has extended characters or not)