check FTP IF file exists

nnCron and nnCron LITE discussion

check FTP IF file exists

Postby sbarak » Wed, 17 Aug 2005, 20:04

I have a script that invokes built in Windows ftp to download a file and
delete it after download. My problem is if the file at the ftp location does
not exist, ftp for some reason overwrites the local file and blanks it out (0
kb). I need a way to make sure that if file is not in ftp location to leave
the local file alone. I don't know how to create an If this Then that Else
quit with remote files on ftp. Any idea on how i can make it so that if
remote file does not exist do NOT overwrite the local file with a blank one?
Posts: 1
Joined: Wed, 17 Aug 2005, 19:55

Postby Valery_Kondakoff » Sat, 20 Aug 2005, 09:41

There is no built-in ftp-functionality in nnCron, but I think you can just change your script to download the files to the temporary directory first and then check if the size of downloaded file is larger than 0 (FILE-SIZE: "file_pattern"). If the size is larger - than move it to the specified local dir.

User avatar
Site Admin
Posts: 769
Joined: Thu, 01 Jul 2004, 20:49
Location: Moscow, Russia

Return to nnCron forum (English)

Who is online

Users browsing this forum: No registered users and 2 guests