os.rename copies when old is in-use - is this deliberate?
"Martin v. Löwis"
martin at v.loewis.de
Sat Dec 3 05:38:06 EST 2005
Tony Meyer wrote:
> Is this the intended behaviour?
Sort-of. os.rename invokes the C library's rename, and does whatever
this does. It is expected that most platform's C libraries do what
the documentation says rename does, but platforms may vary in their
implementation of the C library, and from one compiler version to
the other.
Microsoft's documentation of rename/_rename/_wrename is here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_rename.2c_._wrename.asp
It doesn't say anything about renaming in-use files, either.
Looking at the implementation of _rename, I see that it directly
calls MoveFile, which is documented here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/movefile.asp
That doesn't mention the in-use case, either.
Regards,
Martin
More information about the Python-list
mailing list