Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ah, why not. add --file-events option.

  • Loading branch information...
commit 2ac491dbd30113bfbcc6e5771a1d23ff9445592b 1 parent 822943d
@ttilley ttilley authored
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/rb-fsevent/fsevent.rb
View
1  lib/rb-fsevent/fsevent.rb
@@ -106,6 +106,7 @@ def parse_options(options={})
opts.concat(['--latency', options[:latency]]) if options[:latency]
opts.push('--no-defer') if options[:no_defer]
opts.push('--watch-root') if options[:watch_root]
+ opts.push('--file-events') if options[:file_events]
# ruby 1.9's IO.popen(array-of-stuff) syntax requires all items to be strings
opts.map {|opt| "#{opt}"}
end

8 comments on commit 2ac491d

@ttilley
Collaborator

hey @thibaudgg - think it'd be fun to see just how quickly this could grind guard/listen to a halt and/or result in the software equivalent of an epileptic seizure?

@thibaudgg
Owner

mmm, it works on all OS X release?

@ttilley
Collaborator

just lion and mountain lion.

@thibaudgg
Owner

ok, nice. Indeed I could be a nice addition to guard/listen when supported. Linux adapter works at files level too but we always rescan the whole file directory to have a homogenous behavior on each platform I think.

@ttilley
Collaborator

The binary exits with a failure status if you try to use a feature your OS doesn't support:

kayla:~ travistilley$ ./fsevent_watch --file-events .
MacOSX 10.7 or later required for --file-events
kayla:~ travistilley$ echo $?
1

So far the only features that can fail are ignore-self (useless since fsevent_watch is a separate process) and file-events. I had to create a compat header so that fsevent_watch compiled on 10.6 could use 10.7 features without being re-compiled:

#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
// ignoring events originating from the current process introduced in 10.6
extern FSEventStreamCreateFlags kFSEventStreamCreateFlagIgnoreSelf;
#endif

#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
// file-level events introduced in 10.7
extern FSEventStreamCreateFlags kFSEventStreamCreateFlagFileEvents;
extern FSEventStreamEventFlags  kFSEventStreamEventFlagItemCreated,
                                kFSEventStreamEventFlagItemRemoved,
                                kFSEventStreamEventFlagItemInodeMetaMod,
                                kFSEventStreamEventFlagItemRenamed,
                                kFSEventStreamEventFlagItemModified,
                                kFSEventStreamEventFlagItemFinderInfoMod,
                                kFSEventStreamEventFlagItemChangeOwner,
                                kFSEventStreamEventFlagItemXattrMod,
                                kFSEventStreamEventFlagItemIsFile,
                                kFSEventStreamEventFlagItemIsDir,
                                kFSEventStreamEventFlagItemIsSymlink;
#endif
@thibaudgg
Owner

Ok, we can handle that on Listen side

@ttilley
Collaborator

@dbussink sending a patch reminded me that this project still exists and that it's in need of some love (and completing all the half or mostly implemented features that have been sitting there because I ran off after a shiny object or some such).

So... I guess next is fixing it so that 100% of the metadata possible is passed on from fsevent_watch to rb-fsevent. I already have a TNetString output format in fsevent_watch, so it really just requires some tweaking for clarity and a small chunk of deserializing code on the ruby side.

@thibaudgg
Owner

nice! :+1:

Please sign in to comment.
Something went wrong with that request. Please try again.