Thursday, 5 September 2013

Empty File as soon as it's FTP'd over

Empty File as soon as it's FTP'd over

So here is the story:
Bob FTPs a file from Florida to Chicago and names it XXYZ.tmp. He then
terminates his connection and after waiting 6 seconds re-establishes a
connection which he then renames the XXYZ.tmp file to XXYZ.pck.
Joe has a (C++) program running to scan the directory to look for files
that end in .pck. The contents are read in and processed line by line do
perform various tasks and then performs an archive of the file.
The issue Joe is seeing is in random cases the file being read in
initially is empty, but when it goes to get archive it contains the
desired information. Another case is there isn't anything to process and
when it gets archived it gets archived as empty. About 99% of the time it
works perfectly for Joe.
The next approach is going to put a check on the file and ensure the size
is greater than 0, but I still want to know how this happening. Any ideas?
Edit 1: Joe has Linux and Bob has a Windows. Edit 2: Small snippet from
the FTP log. CWD FromHost 250 0 0 /FromHost RNFR batch20130904092313.tmp
350 0 0 /FromHost/batch20130904092313.tmp RNTO batch20130904092313.pck 250
0 0 /FromHost/batch20130904092313.pck QUIT - 221 0 0

No comments:

Post a Comment