I use WS_FTP Pro to connect to a remote FTP server using a batch file and WSFTP script commands.

 

Here is the nuts and bolts of the script

 

USER ********

PASS ********

ONERROR GOTO close

CONNECT x.x.x.x

ONERROR GOTO close

LCD D:\HL7\IN\211

CD /pickup

MGET *.* D:\HL7\IN\211 1

MDELETE *.*

ONERROR CONTINUE

LABEL close

CLOSE

LABEL end

 

 

What happens occasionally is that I receive 0 byte file from the server. The reason is that when the remote server is writing to a file but has not closed the file it is a 0 byte file.  The problem of course is that the server side is not finished writing to the file so I don’t want that file and for sure I don’t want to delete it.

 

I am unable to locate any functions in WSFTP scripting that allow me to check for file size or file permissions otherwise I might be able to rewrite the MGET section into a loop or something of that nature, checking some parameter about each file before I retrieve it and skipping the 0 byte files

 

Can anyone toss me some ideas on a way I might be able to get something like this to work. Ipswitch support did not have any suggestions.

 

Richard L. Hedrick

 

 

Reply via email to