WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Auto Delete files of a size (Read 3464 times)
trogers
YaBB Newbies
*
Offline



Posts: 1
Auto Delete files of a size
Jul 18th, 2007 at 8:44pm
 
Ok, have seen several topics close to this question, but the each appear to differ slightly in a material way so I thought I would ask my specific question. 

I am running a bat file which queries data and produces a file into a specific directory.  The size of the file created is dependant on the result of the query.  I need to delete (as soon as it's created) every file of less than a certain size.

I saw the size variable available for functions other than delete.  Can anyone help me get this done?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2232
The Netherlands
Re: Auto Delete files of a size
Reply #1 - Jul 19th, 2007 at 3:06pm
 
Hi,

There is no option to select only files of a certain size. However, what you can do is make use of the environment variables that watchDirectory creates before it runs your batch script (see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html for the complete list). Then let WD run a .bat file for all new files, and let the batch script delete files based on their size.
For example:
Code:
IF %WD_FILE_SIZE% LEQ 1024 DEL "%WD_FILE%" 


The above deletes all files smaller or equal to 1024 bytes.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1