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
Trigger on File Size (Read 987 times)
Doug P
YaBB Newbies
*
Offline



Posts: 1
Trigger on File Size
Apr 30th, 2015 at 1:22am
 
I need to trigger actions based upon files size GREATER THAN xxx.  I do not find a manner to do that.

I have recurring report that is generated by an accounting package.  The report is generated regardless of any data on the report.  I know the file size without any data will be 60kb.  So I only wand to process (ie Send Email) when the file size is greater than 60 KB.   And ideas?
Doug P
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: Trigger on File Size
Reply #1 - Apr 30th, 2015 at 5:59am
 
Hello Doug,

You can use a script on "Filter Events" - http://www.watchdirectory.net/wdhelp/help/filter_events.html

Something like this:
Code:
::  if the file size is not available, it is probably a directory
IF "%WD_FILE_SIZE%" EQU "" GOTO :SayNo

IF %WD_FILE_SIZE% LEQ 60000 GOTO :SayNo
GOTO :SayYes

:SayYes
ECHO Y > "%WD_FILTERRESULT%"
GOTO :EOF


:SayNo
ECHO N > "%WD_FILTERRESULT%"
GOTO :EOF
 

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