Skip to content
Prev 308192 / 398503 Next

Moving a file from one location to another

On 17/10/2012 13:59, Berend Hasselman wrote:
You are not.

On Windows, file.rename() can move a normal file from one directory to 
another, even to a directory on another volume.

What it cannot do is move a directory from a directory on one file 
system (volume in Windows' parlance) to a directory on another.

Basically no program can really move files between file systems, but 
some OSes have an atomic copy-and-delete operation and others (including 
recent versions of Windows) emulate the move by copying and then 
deleting, but not recursively and so only for normal files.

It is hard to write precise documentation where on a POSIX file system a 
directory is a file and on a Windows file system it is not.  And you can 
have either type of file system on either a POSIX OS or Windows.