Created
August 9, 2008 21:49
-
-
Save ymendel/4707 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cassady:~ yossef$ irb | |
irb(main):001:0> require 'rubygems' | |
=> true | |
irb(main):002:0> require 'fsevents' | |
=> true | |
irb(main):003:0> stream = FSEvents::Stream.watch(File.expand_path('~/tmp')) do |events| | |
irb(main):004:1* p events | |
irb(main):005:1> end | |
=> #<FSEvents::Stream:0x1d8ad3c @dirs={}, @stream=#<OSX::ConstFSEventStreamRef:0x1d8ab34>, @paths=["/Users/yossef/tmp"], @mode=:mtime, @flags=0, @context=nil, @callback=#<Proc:0x01d8ae90@(irb):3>, @last_event=Sat Aug 09 16:47:55 -0500 2008, @latency=1.0, @allocator=nil, @since=-1> | |
irb(main):006:0> stream.run | |
(in other window) | |
Cassady:~/tmp yossef$ cp ~/Music/test2.flac . | |
(in this window) | |
[#<FSEvents::Event:0x1d86ca0 @stream=#<FSEvents::Stream:0x1d8ad3c @dirs={}, @stream=#<OSX::ConstFSEventStreamRef:0x1d8ab34>, @paths=["/Users/yossef/tmp"], @mode=:mtime, @flags=0, @context=nil, @callback=#<Proc:0x01d8ae90@(irb):3>, @last_event=Sat Aug 09 16:52:24 -0500 2008, @latency=1.0, @allocator=nil, @since=-1>, @path="/Users/yossef/tmp", @id=1632706003>] | |
[#<FSEvents::Event:0x1d86840 @stream=#<FSEvents::Stream:0x1d8ad3c @dirs={}, @stream=#<OSX::ConstFSEventStreamRef:0x1d8ab34>, @paths=["/Users/yossef/tmp"], @mode=:mtime, @flags=0, @context=nil, @callback=#<Proc:0x01d8ae90@(irb):3>, @last_event=Sat Aug 09 16:52:49 -0500 2008, @latency=1.0, @allocator=nil, @since=-1>, @path="/Users/yossef/tmp", @id=1632706355>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment