Check out files in directory

S

Steph

Hi,

Users send files via FTP in a specific directory on our server.
I need to create a program that checks out the arrival of a file (24/24,
7/7...) in the directory and then that performs some manipulations with this
file.
But, i need the file to be completely transfered before manipulating it.
What is the best way to wait the transfer to be completed ?

Thanks.
 
G

Guest

We create a second control file on the FTP directory once the first
file is completely transferred.
 
E

ESPNSTI

I'm no expert on FTP, but probably the simplest way is to check to see if
the filesize remains steady for a certain time period before concluding that
it's complete.
This is not foolproof however.
Alternatively, IF you can count on users sending a checksum file (or
something similar) along with the actual file, then you can use that to
verify that the file is complete.
 
S

Steph

Thanks, but i don't understand, what do you mean by "create a second control
file on the FTP directory" ? How do you do that ?
 
G

Guest

For example, mydata.dat is the file being transferred. You need to know
when that file has been completely transferred so you can start
manipulating it. One mydata.dat has been transferred then have the
sending process send a mydata.dat.control file. Your application can
then just wait for *.control files to arrive.

This is of course making the assumption that you have some control over
the sending side of things?

You could put a checksum (and/or expected file size) in the control
file as mentioned on the other post - but it's a redundant as FTP
should be checksummed anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top