Skip to content

Instantly share code, notes, and snippets.

@piscisaureus
Created November 4, 2011 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piscisaureus/1340747 to your computer and use it in GitHub Desktop.
Save piscisaureus/1340747 to your computer and use it in GitHub Desktop.
diff --git a/include/uv.h b/include/uv.h
index 9d661e5..afdc301 100644
--- a/include/uv.h
+++ b/include/uv.h
@@ -1166,13 +1166,31 @@ struct uv_fs_event_s {
*/
UV_EXTERN void uv_loadavg(double avg[3]);
+
/*
-* If filename is a directory then we will watch for all events in that
-* directory. If filename is a file - we will only get events from that
-* file. Subdirectories are not watched.
-*/
+ * Flags to be passed to uv_fs_event_init.
+ */
+enum uv_fs_event_flags {
+ /*
+ * By default, if the fs event watcher is given a directory name, we will
+ * watch for all events in that directory. This flags overrides that behavior
+ * and makes fs_event report only changes to the directory entry itself. This
+ * flag does not affect individual files watched.
+ */
+ UV_FS_EVENT_WATCH_ENTRY,
+
+ /*
+ * By default uv_fs_event will try to use a kernel interface such as inotify
+ * or kqueue to detect events. This may not work on remote filesystems such
+ * as NFS shares. This flag makes fs_event fall back to calling stat() on a
+ * regular interval.
+ */
+ UV_FS_EVENT_POLL = 2
+};
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment