Open sgbotsford opened 6 years ago
I'll have a look at inotify's event flags: they may not be all supported and/or updated in the current version.
Also, is there any way to retrieve the name or process number of the program that did the opening?
Nope, at least not portably.
My main use case is "when I save a file, do something".
Currently fsevents
does not satisfy this use case very well.
For example, using Atom editor:
--event Updated
yields three? of the same event on each save--event AttributeModified
yields zero events on saveComparing this to inotifywait, I have CLOSE_WRITE
firing ONCE on each save.
Hi? Where is the list of all possible events?
Thanks. grep
rules
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. */
};
@jchook Did you solve it? If I was modifying my file (without saving it) some events also got triggered. I just want to catch one event: on-save.
Looking at the event flags, there doesn't seem to be one for file open/close events, and at least the Linux ionotify has this capability.
Also, is there any way to retrieve the name or process number of the program that did the opening?