jordansissel / eventmachine-tail

Ruby EventMachine file tailing and friends. 'gem install eventmachine-tail' to install.
127 stars 16 forks source link

bug with @file being null #17

Closed abacha closed 4 months ago

abacha commented 12 years ago

I don't know exactly why but apparently @file gets nil here: @position = @file.sysseek(0, IO::SEEK_END)

and its raising an error

EventMachine error: undefined methodsysseek' for nil:NilClass - /usr/lib64/ruby/gems/1.8/gems/eventmachine-tail-0.6.3/lib/em/filetail.rb:106:in initialize'

I think it has to do with a reopening of a file

maybe check if @file.nil?

darkskiez commented 11 years ago

I've seen this issue too, its when you've called .close on a reader when its not fully initialized yet.

Its not easy to work around this, maybe add your own close that waits for eof to have been called, not ideal.