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
Alert if filename found in root of sub-folders (Read 1485 times)
wesman
Junior Member
**
Offline



Posts: 75
Australia
Alert if filename found in root of sub-folders
Feb 9th, 2016 at 3:20am
 
Hi Gert

I have got a folder for example called "home". Inside "home" there are a number of sub-folders, for example:

test
test1
test2

Inside each of these there are additional sub-folders. I would like to know how to set up a filename monitor that monitors for files inside the sub-folders in the home folder, but does not monitor the sub-folders inside those sub-folders.

For example, I want it to monitor and alert for changes inside:

home/test
home/test1
home/test2

But NOT monitor and alert for changes inside for example:

home/test/sub1
home/test/sub2/abc
home/test1/xyz
home/test1/abc/123
home/test2/fgh

Basically, I want to use a single task to only monitor for changes inside the "root" of each sub-folder inside the main home folder and not monitor for any sub-folder levels beneath that.

ie

monitor for files inside home/sub

but not for files inside home/sub/sub or home/sub/sub/...etc

How can I do that please?

Thanks

Wes
Back to top
« Last Edit: Feb 9th, 2016 at 1:41pm by wesman »  
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2232
The Netherlands
Re: Alert if filename found in root of sub-folders
Reply #1 - Feb 9th, 2016 at 8:06am
 
Hello Wes,

First I thought that should be easy enough with a filter ( http://www.watchdirectory.net/wdhelp/help/filter_events.html ) defined
"relative directory does not contain \ ".
Where "relative directory" is the directory structure "below" the monitored directory.

I now see that "relative directory" is not yet supported by filter events. We will have a beta up soon with this new filter.
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
 
wesman
Junior Member
**
Offline



Posts: 75
Australia
Re: Alert if filename found in root of sub-folders
Reply #2 - Feb 9th, 2016 at 1:29pm
 
Many thanks Gert - please can you let me know when you think that Beta will be ready?

Thanks

Wes
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2232
The Netherlands
Re: Alert if filename found in root of sub-folders
Reply #3 - Feb 9th, 2016 at 2:16pm
 
Probably tomorrow or thursday, it will be posted on this forum.
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
 
Gert
YaBB Administrator
*****
Offline



Posts: 2232
The Netherlands
Re: Alert if filename found in root of sub-folders
Reply #4 - Feb 11th, 2016 at 10:38am
 
Oops, I didn't look properly..... The filter option is already present.

On "Filter Events" you can add a filter saying
"when the relative directory contains \ then do not process the event".

I assume you monitor C:\Home incl subdirs.
When C:\Home\hello.txt is detected, its relative directory is empty, so it will be processed.
When C:\Home\sub1\hello.txt is detected, its relative directory is "sub1", so it will be processed.
When C:\Home\sub1\sub2\hello.txt is detected, its relative directory is "sub1\sub2", so it will NOT be processed because it contains a \.
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
 
wesman
Junior Member
**
Offline



Posts: 75
Australia
Re: Alert if filename found in root of sub-folders
Reply #5 - Feb 12th, 2016 at 12:34am
 
Thanks Gert. However, I have put this in place but it isn't working as expected. It seems to detect even the first level sub-folder (i.e. sub1) as containing a \ and therefore doesn't process the files even in that folder.

What can I do to resolve this?

Thanks

Wes
Back to top
 
 
IP Logged
 
wesman
Junior Member
**
Offline



Posts: 75
Australia
Re: Alert if filename found in root of sub-folders
Reply #6 - Feb 12th, 2016 at 12:58am
 
Hi Gert.

I solved it - since the direct solution, i.e.

if relative directory contains \ then do not process

wasn't working correctly, I changed it to use a wildcard pattern as follows:

if relative directory matches *\*\* then do not process

And this worked perfectly ... since any first level subfolder contains only one \ then the files in that folder will be processed; whereas any level below that (e.g. sub1\sub2 or sub1\sub2\sub3) contains more than one \ and will therefore NOT be processed.

Many thanks

Wes
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1