Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation Minor FOLDERMONITOR Help Correction

Jun
762
16
The syntax at the top says FOLDERMONITOR [/C [folder]]. However, under the /C option, the text reads

/CIf name is specified, remove the monitor for that folder.

The word "name" should be "folder". You seem to use "folder name" elsewhere, so the same should probably be used here as well. So I guess it is just the word "folder" that is missing after "name".
 
One more thing. I believe that the "/C folder" option deletes all monitoring commands for that folder. You recommend not creating more than one, but (1) it is possible to do it and (2) there may be circumstances in which it is necessary (e.g., because of different include or exclude specifications or different commands to be run for creations and deletions). So the help should read that "all monitors for that folder" will be removed.

Would it make sense to have an option to edit a monitoring command? It would probably have to work by importing the current monitor and if changed, then deleting the current monitor and loading the new one. One could do this with a scripts, but as currently implemented there is no way to get the settings for many of the options (e.g., /W, /E, /I). The report from the command with no arguments does not include those values, so there seems to be no way to recover them.
 
One more thing. I believe that the "/C folder" option deletes all monitoring commands for that folder. You recommend not creating more than one, but (1) it is possible to do it and (2) there may be circumstances in which it is necessary (e.g., because of different include or exclude specifications or different commands to be run for creations and deletions). So the help should read that "all monitors for that folder" will be removed.

You can create more than one, but IMO it would be dumb. From the help:

"If you want to monitor multiple conditions for a file or folder, put them into a single FOLDERMONITOR command. FOLDERMONITOR creates a separate thread for each FOLDERMONITOR command, so if you have multiple commands you will be wasting CPU time, RAM, and risk having command executed simultaneously in different threads."

I have never known any circumstance where it would be necessary to do this. And the way Windows works pretty much guarantees you're going to shoot off your feet if you don't have (1) a REALLY good reason, (2) do it in separate TCC processes, and (3) an intimate knowledge of how the Windows filesystem and the ReadDirectoryChanges API work. Which Microsoft doesn't document in detail.
 
Would it make sense to have an option to edit a monitoring command? It would probably have to work by importing the current monitor and if changed, then deleting the current monitor and loading the new one. One could do this with a scripts, but as currently implemented there is no way to get the settings for many of the options (e.g., /W, /E, /I). The report from the command with no arguments does not include those values, so there seems to be no way to recover them.

It would be impossible without killing the current monitoring thread (the Windows API does not allow modifications on the fly).

If you're going to kill it anyway, I don't see a great advantage in a "modification" option, and I can see many ways it could go seriously wrong if you didn't know what the existing options were.
 
You can create more than one, but IMO it would be dumb. From the help:

Yes, I read that. However, since it is possible, for whatever reason, to have more than one monitor operating for a given folder, the wording in the help could be improved. As I wrote in the topic line, these corrections are minor. However, when I was a software developer, I always appreciated even the smallest corrections. The big, and critical, correction was that the W option is in seconds, not milliseconds.

It would be impossible without killing the current monitoring thread (the Windows API does not allow modifications on the fly).

That's what I wrote. If the editing changed anything (or perhaps in all cases), the old monitor would have to be cancelled and the new one created. Perhaps it's not worth the trouble. I just found myself wanting to do it while I was experimenting, but I could have handled it in another way (e.g., a temporary alias something like "zz=fm /c & fm args". The alias could be edited with ESET. Or command line recall could be used.

There is still the issue of knowing what the option settings are for a running monitor. FOLDERMONITOR with no options shows only some of the settings, and there doesn't seem to be any way to retrieve the others. I'm just starting to play with this functionality, so I don't know how useful or important it would be to be able to discover those other settings. Is there any reason why FOLDERMONITOR with no options could not display them all?
 
Back
Top