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.98k stars 327 forks source link

Document Event Types in man page documentation #207

Open aneilbaboo opened 6 years ago

aneilbaboo commented 6 years ago

The man page says "See Event Types", but provides no further information. It would be helpful to see the list of event types and the associated numeric values.

For others who have searched for this, documentation is here: http://emcrisostomo.github.io/fswatch/doc/1.11.3/fswatch.html/Invoking-fswatch.html#Event-Flags

NoOp: 0
PlatformSpecific: 1
Created: 2
Updated: 4
Removed: 8
Renamed: 16
OwnerModified: 32
AttributeModified: 64
MovedFrom: 128
MovedTo: 256
IsFile: 512
IsDir: 1024
IsSymLink: 2048
Link: 4096
Overflow: 8192
kuvaldini commented 5 years ago

I looked for event names and found them in code with magic command grep:

 enum fsw_event_flag
  {
    NoOp = 0,                     /**< No event has occurred. */
    PlatformSpecific = (1 << 0),  /**< Platform-specific placeholder for event type that cannot currently be mapped. */
    Created = (1 << 1),           /**< An object was created. */
    Updated = (1 << 2),           /**< An object was updated. */
    Removed = (1 << 3),           /**< An object was removed. */
    Renamed = (1 << 4),           /**< An object was renamed. */
    OwnerModified = (1 << 5),     /**< The owner of an object was modified. */
    AttributeModified = (1 << 6), /**< The attributes of an object were modified. */
    MovedFrom = (1 << 7),         /**< An object was moved from this location. */
    MovedTo = (1 << 8),           /**< An object was moved to this location. */
    IsFile = (1 << 9),            /**< The object is a file. */
    IsDir = (1 << 10),            /**< The object is a directory. */
    IsSymLink = (1 << 11),        /**< The object is a symbolic link. */
    Link = (1 << 12),             /**< The link count of an object has changed. */
    Overflow = (1 << 13)          /**< The event queue has overflowed. */
  };