WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> How To...  Delete a 0K File?
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1079388302

Message started by rdillard on Mar 16th, 2004 at 5:05am

Title: How To...  Delete a 0K File?
Post by rdillard on Mar 16th, 2004 at 5:05am
Does anyone know how I could delete a 0K file?  Purpose being, we use Watch Directory to monitor a set of folders we place files in that are then FTPd to customers.  Once WatchDirectory notices a file in a specific folder, it starts a FTP program with a specific set of parameters for the customer but we would prefer that the first step be to see if there is actually anything in the file or not.

Thanks for your help,
Robert

Title: Re: How To...  Delete a 0K File?
Post by Gert on Mar 16th, 2004 at 12:45pm
Hello Robert,

If you use the .bat file WDAutoFtp.bat, that is installed with watchDirectory, please find the following line:


Code (]
:FtpTheFile
[/code):



And change it to
[code]
:FtpTheFile
IF %WD_FILE_SIZE% EQU 0 (
  DEL "%WD_FILE%"
  GOTO :Quit
)

This checks for a file of size zero. If you, for example, want to check for files with a size less than 1000 bytes, use the next code fragment instead:
[code]
:FtpTheFile
IF %WD_FILE_SIZE% LSS 1000 (
  DEL "%WD_FILE%"
  GOTO :Quit
)
[/code]

If you are not using wdautoftp.bat as the basis for your .bat file, or are unsure how to implement this, please zip your .bat file and sent it to support at gdps.dk and I will change it for you.

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.