Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI

I currently run a process where i export a file to an FTP server and another process that collects the file.

As the process runs every 5mins i found sometimes that the file being uploaded to the FTP server is sometimes not yet completed before the other process starts running so only half the file gets collected from the FTP.

What would be the best way for me to ensure that the complete file gets picked up?
Posted

1 solution

Strange that you do not get an ACCESS DENIED error. I suggest the "second process" to check for full access to the file first, by creating a FileStream with FileShare.None. If that fails, wait a few seconds, then try again till a timeout or full access. Only then start the actual processing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900