WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> Trigger on File Size
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1430349737

Message started by Doug P on Apr 30th, 2015 at 1:22am

Title: Trigger on File Size
Post by Doug P on 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

Title: Re: Trigger on File Size
Post by Gert on 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
[/code]

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