in reply to Re: Continuously polling multiple directories for file transfer?
in thread Continuously polling multiple directories for file transfer?
I am using a possibly outdated FTP RFC. See the commands STOU, RNFR, and RNTO.
Along these lines, it might be better to try to STOU the file into a unique file name, and then rename the file once it has been completely uploaded. This is similar to the techniques used under *nix to try to assure atomicity. If you create the file under the same name as what it needs to be, and your ftpd does not do stuff behind the scenes to ensure that when a file is added to the file system it is complete, you will have this race condition.
it's dangerous to assume that the file system performs atomic operations on disk.
Under POSIX, I believe that the atomic semantics are "required", but under Windows, this may not be the case. That is, however, not saying that RNFR and RNTO require the use of the rename() POSIX semantics.
--MidLifeXis
|
|---|