commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: [FTP incomplete file transfer]
Date Sun, 27 May 2007 15:50:59 GMT

In message <59d250e00705250851o4eb10d1fx51d40c92ec616bf2@mail.gmail.com>, "=?IS
O-8859-1?Q?Fran=E7ois_SENEQUIER?=" writes:
>So I would prefer trying to put a lock on the file before trying to download
>the file. So if the file is uploading, the lock will fail. The file is not

You can't lock a remote file on an FTP server from an FTP client.

>Or have you got another way to solve the problem ?

I can think of a couple of kluges that all have problems, but your best
bet is probably to list the file, wait 5 to 10 seconds and then list
it again.  If the file size increased, then the file is being uploaded.
If the file size doesn't change, that's no guarantee the file is safe
to download (because the upload may have stalled), but at least it
will work for a good percentage of the cases you encounter.

daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message