Link to home
Start Free TrialLog in
Avatar of jmnason
jmnason

asked on

FTP creates 0 byte file

Hi ya,
     We are having an intermittent problem with FTP.  At times while retrieving files from the FTP server, a 0 byte file is created.  WHY?

We use Windows 2000 server and client. Is this a problem with FTP server or configuration?

Thanks!
Avatar of PNJ
PNJ

How are you determining whether there's a file ready to pick up? I had this once because I was doing a DIR$ with "*.DAT". The FTP program drops the (eg) FILE.DAT into the directory and CREATES the file first. It then transfers data into that file before closing it. Windows only see the number of bytes in the file when the FTP transfer has finished and the file is CLOSED. Thus, you can DIR$("*.DAT") and see the file, but if you pick it up before the transfer is finished it'll be empty. What we did was to get the FTP transfer to FTP over "*.X" and then do an FTP rename command to "*.DAT" after the transfer was done.

Alternatively you can simply ignore 0 byte files and then pick 'em up again next loop.

Pete
I usually find these kinds of files when the source file is not specified completely. For example, you may CD to a directory and then send that file:

put filename

However, the source file may not be there correctly. Better to use the whole path:

put some-directory\another-directory\filename
ASKER CERTIFIED SOLUTION
Avatar of jmnason
jmnason

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi jmnason,
This old question (QID 20566453) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer