Forum Moderators: coopster & phranque

Message Too Old, No Replies

NET::FTP -> Insure File not being used by someone else?

Prevent Downloading Partiatly Uploaded Files

         

Shadi

12:33 am on Sep 1, 2003 (gmt 0)

10+ Year Member



Am back again with more NET::FTP Issues, the file i download from the FTP server every night gets uploaded at random times every day, and is varis in size, thus you don't know when it will be uploaded or how big it is. Now thats fine for everything am doing, the trouble is i don't want to download a file what it is being uploaded, as i have tested FTP programs etc, and even if someone is uploading they will STILL download the file not relizing it is complete...

So is there a way to avoid this?! Make sure no one else is using the file at the same time you wanna upload it?

Storyteller

3:48 am on Sep 1, 2003 (gmt 0)

10+ Year Member



Check modification time of the file. Only start downloading the file if enought time (say, 10 minutes) has been passed since it was last changed. While it's being uploaded, its modification time should change every second.

If that doesn't work (buggy ftp server or something), you can detect that the file is being uploaded by its size growing.