Michiel Overtoom wrote:
Very good point. Thanks.
~Ethan
Ethan wrote:
>
>
Caveat -- this is dependent on the operating system!
>
Windows will indeed not allow you to rename or delete a file that's still
open for writing by another process, at least not when the file is on a
local NTFS filesystem, but don't count on this on Unix or networked
filesystems. There you can easily rename, move or delete a filename from a
directory whilst other processes still write to it. After all, a directory
is nothing else than a list of filenames which map to certain inodes.
>
>One more option may be to attempt to rename
>the file -- if it's still open for copying, that will fail;
>success indicates the copy is done.
>the file -- if it's still open for copying, that will fail;
>success indicates the copy is done.
Caveat -- this is dependent on the operating system!
>
Windows will indeed not allow you to rename or delete a file that's still
open for writing by another process, at least not when the file is on a
local NTFS filesystem, but don't count on this on Unix or networked
filesystems. There you can easily rename, move or delete a filename from a
directory whilst other processes still write to it. After all, a directory
is nothing else than a list of filenames which map to certain inodes.
~Ethan