#1 2020-10-13 16:56

rol
Member
Registered: 2020-07-31
Posts: 6

File Size event limitation

I think I've found an important limitation with the File Size event.  I am watching a small file in the Windows %TEMP% folder.  It contains a single word, or is empty.  I want to trigger the event when it is empty.  When I select "trigger when size reaches 0 bytes", the triggers occurs when the file is indeed empty, and that's perfect, but also when it contains a few characters, and that's not what I want.  I guess that the logic is made to watch a file that grows continuously, and therefore that any size above or equal to the specified size is considered as triggered.  But that means that it is not possible to watch a file whose size is decreasing, or made empty, as I need.  Perhaps it should be possible to trigger the event when it reaches N bytes or above, or when it is decreased to reach N bytes or below.  Could you consider to add that possibility, or simply add an "invert" checkbox ?

Also, when the file is not present, the status is "File not found".  Does that mean that the event is ignored (and therefore, that the program reacts as if it is triggered) ?  It's what I would like.

Offline

#2 2020-10-16 20:30

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: File Size event limitation

rol wrote:

Perhaps it should be possible to trigger the event when it reaches N bytes or above, or when it is decreased to reach N bytes or below. Could you consider to add that possibility, or simply add an "invert" checkbox ?

Absolutely. This option can be added relatively quickly.

Keep on eye on this thread for updates.

rol wrote:

Also, when the file is not present, the status is "File not found".  Does that mean that the event is ignored (and therefore, that the program reacts as if it is triggered) ?  It's what I would like.

Internally, when the file or directory does not exist the size variable will be equal to "-1". The event continues to operate as normal.

Offline

#3 2020-10-16 21:53

rol
Member
Registered: 2020-07-31
Posts: 6

Re: File Size event limitation

OK, thanks.
-1 for file not found is good for me too.

Offline

#4 2020-10-25 11:51

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: File Size event limitation

This feature has been implemented in Shutter 4.4.0.4 Beta.

Relevant entries from the changelog:

* New event option to trigger when the file size is below a certain size.
* The event option to trigger when the file size reaches a certain size was changed to trigger when strictly above a certain size. Existing event configurations will continue to work in backwards compatible fashion until edited.

Please try the latest development version.

Offline

#5 2020-10-25 15:15

rol
Member
Registered: 2020-07-31
Posts: 6

Re: File Size event limitation

Seems to work perfectly, at least for my usage.
Huge thanks !

Offline

Board footer

Powered by FluxBB