Foldermonitor Issue

Dec 2, 2008
226
2
Canada
Why does only one FOLDERMONITOR command work at a time? Here is an example session:

C:\> FOLDERMONITOR /s "c:\Creative Focus Publishing" /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Monitor 1 100 "CFP-Folder-Handler1" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
C:\> touch "c:\Creative Focus Publishing\eBook\Catalog\Christian\Money - Master or Servant\Money - Master or Servant.epub"
2018-02-01 21:44:21.961 C:\Creative Focus Publishing\eBook\Catalog\Christian\Money - Master or Servant\Money - Master or Servant.epub

C:\> foldermonitor
c:\Creative Focus Publishing CREATED MODIFIED RENAMED (1/FOREVER) Monitor 1 100 "CFP-Folder-Handler1" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"

C:\> foldermonitor /c
C:\> FOLDERMONITOR /s "c:\Indesign Publishing" /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Monitor 1 100 "CFP-Folder-Handler2" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
C:\> touch "c:\Indesign Publishing\Art\Artistic Ideas & Inspirations\About the Artist.indd"
2018-02-01 21:45:45.567 C:\Indesign Publishing\Art\Artistic Ideas & Inspirations\About the Artist.indd

C:\> foldermonitor
c:\Indesign Publishing CREATED MODIFIED RENAMED (1/FOREVER) Monitor 1 100 "CFP-Folder-Handler2" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"

C:\> foldermonitor /c
C:\> FOLDERMONITOR /s "c:\Creative Focus Publishing" /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Monitor 1 100 "CFP-Folder-Handler1" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
C:\> FOLDERMONITOR /s "c:\Indesign Publishing" /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Monitor 1 100 "CFP-Folder-Handler2" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
C:\> touch "c:\Creative Focus Publishing\eBook\Catalog\Christian\Money - Master or Servant\Money - Master or Servant.epub"
2018-02-01 21:46:38.528 C:\Creative Focus Publishing\eBook\Catalog\Christian\Money - Master or Servant\Money - Master or Servant.epub

C:\> touch "c:\Indesign Publishing\Art\Artistic Ideas & Inspirations\About the Artist.indd"
2018-02-01 21:46:50.566 C:\Indesign Publishing\Art\Artistic Ideas & Inspirations\About the Artist.indd

C:\> foldermonitor
c:\Creative Focus Publishing CREATED MODIFIED RENAMED (1/FOREVER) Monitor 1 100 "CFP-Folder-Handler1" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
c:\Indesign Publishing CREATED MODIFIED RENAMED (0/FOREVER) Monitor 1 100 "CFP-Folder-Handler2" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"


I show that both FOLDERMONITOR commands work when they run separately but when executed together and files in both directories are touched, only the first FOLDMONITOR command fires. Does this mean only one FOLDERMONITOR command per session?

Craig
 
May 20, 2008
11,424
99
Syracuse, NY, USA
Here's another example that seems to confirm Craig's observation.
Code:
v:\> del dir1\file1 dir2\file2
Deleting V:\dir1\file1
Deleting V:\dir2\file2
     2 files deleted

v:\> foldermonitor /s v:\dir1 CREATED FOREVER echo %%_folderaction %%_folderfile1 ^> v:\fmlog1.txt

v:\> foldermonitor /s v:\dir2 CREATED FOREVER echo %%_folderaction %%_folderfile1 ^> v:\fmlog2.txt

v:\> foldermonitor
v:\dir1   CREATED   (0/FOREVER)   echo %_folderaction %_folderfile1 > v:\fmlog1.txt
v:\dir2   CREATED   (0/FOREVER)   echo %_folderaction %_folderfile1 > v:\fmlog2.txt

v:\> touch /c v:\dir1\file1
2018-02-02 13:27:05.945  V:\dir1\file1

v:\> touch /c v:\dir2\file2
2018-02-02 13:27:21.124  V:\dir2\file2

v:\> foldermonitor
v:\dir1   CREATED   (1/FOREVER)   echo %_folderaction %_folderfile1 > v:\fmlog1.txt
v:\dir2   CREATED   (0/FOREVER)   echo %_folderaction %_folderfile1 > v:\fmlog2.txt

v:\> type fmlog1.txt
CREATED file1

v:\> type fmlog2.txt
TCC: (Sys) The system cannot find the file specified.
 "V:\fmlog2.txt"
 
May 20, 2008
11,424
99
Syracuse, NY, USA
A question for cgunhouse ... below, what's the stuff after "FOREVER" and before the command "c:\JPSoft\Batches\CFP-Folder-Handler.btm"?
C:\> FOLDERMONITOR /s "c:\Creative Focus Publishing" /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Monitor 1 100 "CFP-Folder-Handler1" "c:\JPSoft\Batches\CFP-Folder-Handler.btm"
 

rconn

Administrator
Staff member
May 14, 2008
12,365
150
Fixed for 22.0.38.

The cause wasn't in the TCC code (which hadn't changed between 20 & 21), it was an overly enthusiastic VS2017 optimizer. I had to mark one of the variables as volatile to prevent the compiler from optimizing away an explicit assignment.
 
Dec 2, 2008
226
2
Canada
A question for cgunhouse ... below, what's the stuff after "FOREVER" and before the command "c:\JPSoft\Batches\CFP-Folder-Handler.btm"?

Hi Vince,

This is a library that I loaded which contains:


Code:
Handler {
  @ECHO OFF
    SETLOCAL
    SET FastTrack=%1
    SET StartupWait=%2
    SET MyTitle=%3
    START %MyTitle /INV /C %4 %5$
    DELAY /M100
    ENDLOCAL
}

Monitor {
  @echo off
  SETLOCAL
  SET DirToMon=%1
  SET FastTrack=%2
  SET DelayTime=%3
  SET HandlerName=%4
  SET HandlerExecutable=%5   
    FOLDERMONITOR /s %1 /E"*.bak" /W100 CREATED MODIFIED RENAMED FOREVER Handler %FastTrack %DelayTime %HandlerName %HandlerExecutable
    ENDLOCAL
}
 
Similar threads
Thread starter Title Forum Replies Date
cgunhouse Foldermonitor with "/E" Option Issue Support 6
twaterloo Foldermonitor Bugs? Support 6
twaterloo FolderMonitor for the 1st time not working Support 5
vefatica FOLDERMONITOR: /= dialog creates malformed command Support 2
C FOLDERMONITOR inactive with multiple /I Support 1
cgunhouse Foldermonitor with /W option Support 10
G FOLDERMONITOR created also firing for delete (and maybe other events) Support 7
vefatica Fixed FOLDERMONITOR causes crash Support 23
mikea FOLDERMONITOR confusions Support 7
cgunhouse Foldermonitor and iftp Support 1
T How to? Using FOLDERMONITOR 1 event causes multiple trigger(ing)s Support 8
Frank question to FOLDERMONITOR Support 14
S Log and foldermonitor problems Support 3
Steve Pitts FOLDERMONITOR missing events?? Support 7
J Still problems understanding "foldermonitor" Support 9
cgunhouse TCToolBar /W Issue Support 2
G v28 Display Issue Support 7
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
fpefpe How to? issue with % and evaluation Support 5
cgunhouse Standard User Account Issue Support 2
samintz WAD Display wrapping issue Support 5
M TCC color issue in ConEmu Support 4
samintz Timer issue Support 4
Alpengreis Documentation Minor issue in help file for view /E Support 1
samintz WAD ANSI issue Support 3
D TCSTART issue after reinstallation Support 14
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
Chen Touboul Overtyping issue - i press the Insert key, help till press enter for new line in TCC Support 2
Y TCC and Cmder imcompatibility issue Support 7
M Another possibly strange remote registry issue Support 5
T WAD bpokestr issue Support 5
D High-DPI Scaling issue Support 1
S CMDebug 22 issue with del command Support 1
samintz Build 38 Install issue Support 5
rps WAD Setlocal issue Support 4
Luiz Rodrigues Issue with Maven Support 1
Seven Update / install issue with 20.0.20.10.32 take command Support 7
Fross WebDav Drive Mapping Issue Support 19
D Upgrade issue Support 3
Fross V20b8 Everything Issue Support 5
T TCC display issue Support 1
cgunhouse _logfile Issue Support 5
T Fixed Querybox issue Support 1
cgunhouse Fixed Share Memory Issue Support 5
Fross TabComplete Argument Issue Support 1
fpefpe How to? Stange start up issue Support 1
C cosmetic issue with LIST's (I) Support 9
jbarnes1967 TC 18.00 x64 issue with lua io.popen() Support 2
D How to? Wildcards as sets - looping issue with FOR and REN Support 7

Similar threads