emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
4.96k stars 327 forks source link

What are my monitor properties? + more undocumented #241

Open doronbehar opened 4 years ago

doronbehar commented 4 years ago

Hey :) This program looks awesome, first time user here.

On GNU/Linux, I'd like to use fswatch to monitor only writes to a file. I'd like to run a markup convertor whenever I perform a write to a README file.

It feels as if the normal fswatch -o README shows also events which are not write because it spits a new line even if I don't write the file but moving my focus to it.

I notice there's --monitor-property name=value but I couldn't find documentation / examples for these properties. fswatch --list-monitors doesn't show any more information. Also, there's --format=FORMAT which perhaps could have been useful to filter out non-write events but I couldn't find documentation for that either :/ I'm not fluent in C enough to look it up my self...

Regards.

steamfire commented 3 years ago

Do you mean EVENT TYPES with the fswatch --event name argument? Probably the "Updated" type is what you want. However, I've noticed some processes do a Remove Create cycle on macos.

The actual type names are not listed in the man pages, but are mentioned in this issue/bug: #207

solarkraft commented 1 year ago

I'm also missing documentation for --format. So far I've found %f (modification type), %p (full path), %n (not sure, perhaps count?), %t (time). Wish there was something for getting the path relative to the current directory.