Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Mar : Re: ftp GET and partial files
| Subject: | Re: ftp GET and partial files |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Mon, 17 Mar 2008 10:21:56 |
"Ray Mond" <nospam@nospam.com> wrote in message
news:47dddb8a$1@newsgroups.borland.com...
> Is there a realiable way to tell the FTP client not to
> copy a file that is currently still in the process of
> being copied or created?
It is the FTP server's responsibility to accept or reject access to files.
It needs to have a way of knowing that files are being written to from an
outside source in order to reject access to them. Chances are, though, that
there is no such communicate implemented on your server, unless it checks
for exclusive rights when accessing a file and then replies accordingly.
That is not likely, though.
On the client side, it can only respond to the server's replies when
attempting to transfer a file. If the server does not reject access, then
the client happily continues downloading.
If the client and server both support the XCRC, XMD5, or XSHA1 command, then
the client could download a file, hash it locally, and then verify if the
hash matches the file on the server. If the hash is different, then
re-download the file again. Eventually, the file on the server side will
stop being copied and the hashes will match. Unless the file is copied
frequently, in which case the hashes may never match, and the client will
just have to stop trying after X number of times.
Gambit