design question, why not always use 'cp --remove-destination'?

Krasimir Angelov kr.angelov at gmail.com
Tue Aug 22 11:16:39 EDT 2006


On 8/22/06, Frederik Eaton <frederik at a5.repetae.net> wrote:
> Perhaps the "Text file busy" error is Unix-specific, but I can imagine
> cases where somebody (other than the OS) might open a file with a
> well-known name and read from various parts of it, and expect it not
> to change underneath them...

Then he/she may expect that the file will not be suddenly unlinked
while he/she is still reading. The documentation for System.IO says
that the implementation should provide single writer - multiple
readers locking. When that is the case then copyFile should fail if
the target fail is open for reading or writing from someone including
the OS. The Unix implementation provides only local locking but the
Windows implementation provides system wide locking.

Cheers,
   Krasimir


More information about the Libraries mailing list