Why not simply use a flags mask. We could have: - an API function that tell which flags are supported on the running arch. - an API function that allow the user to modify an watcher events mask. In <linux/inotify.h> we have: /* the following are legal, implemented events that user-space can watch for */ #define IN_ACCESS 0x00000001 /* File was accessed */ #define IN_MODIFY 0x00000002 /* File was modified */ #define IN_ATTRIB 0x00000004 /* Metadata changed */ #define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */ #define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ #define IN_OPEN 0x00000020 /* File was opened */ #define IN_MOVED_FROM 0x00000040 /*File was moved from X */ #define IN_MOVED_TO 0x00000080 /*File was moved to Y*/ #define IN_CREATE 0x00000100 /* Subfile was created */ #define IN_DELETE 0x00000200 /* Subfile was deleted */ #define IN_DELETE_SELF 0x00000400 /* Self was deleted */ /* the following are legal events. they are sent as needed to any watch */ #define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */ #define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ #define IN_IGNORED 0x00008000 /* File was ignored */ /* helper events */ #define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */ #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ G_FILE_ACCESS_EVENT (1 << 0) G_FILE_MODIFY_CDATA_EVENT (1 << 1) /* content */ G_FILE_MODIFY_MDATA_EVENT (1 << 2) /* meta-data */ G_FILE_MOVED_FROM_EVENT (1 << 3) G_FILE_MOVED_TO_EVENT (1 << 4) G_FILE_CREATED_EVENT (1 << 5) G_FILE_REMOVED_EVENT ( 1 << 6) #define G_FILE_CHANGED_EVENT \ (G_FILE_MODIFY_CDATA_EVENT \ |G_FILE_MODIFY_MDATA_EVENT) #define G_FILE_MOVED_EVENT \ (G_FILE_MOVED_FROM_EVENT \ |G_FILE_MOVED_TO_EVENT) If all events are supported we clearly need to have a public function telling which events are supported... I can't see any way to setup a G_FILE_MOVED_EVENT watch without kernel help. On 5/9/06, Joe Shaw <joeshaw novell com> wrote:
Hi,
On Mon, 2006-05-08 at 22:49 +0100, Emmanuele Bassi wrote:
> typedef enum {
> G_FILE_CREATED_EVENT,
> G_FILE_CHANGED_EVENT,
> G_FILE_REMOVED_EVENT,
> G_FILE_UNKNOWN_EVENT
> } GFileEvent;
Would G_FILE_CHANGED_EVENT be fired on file attribute change (like
chmod, chown, or an extended attribute), or only on file content change?
I think exactly what "changed" means needs to be clearly spec'd out.
Thanks,
Joe
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
-- Person who say it cannot be done should not interrupt person doing it.