Class: BitGirder::Event::File::EventFileFactory
- Inherits:
-
BitGirderClass
- Object
- BitGirderClass
- BitGirder::Event::File::EventFileFactory
- Defined in:
- lib/bitgirder/event/file.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.open(opts) ⇒ Object
399 400 401 |
# File 'lib/bitgirder/event/file.rb', line 399 def self.open( opts ) self.new( opts ).tap { |ff| ff.send( :init_reopen ) } end |
Instance Method Details
#close_file(io) ⇒ Object
395 396 397 |
# File 'lib/bitgirder/event/file.rb', line 395 def close_file( io ) io.close end |
#open_file ⇒ Object
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/bitgirder/event/file.rb', line 373 def open_file if @reopen_targ io = ::File.open( @reopen_targ, "a+b" ) @reopen_targ = nil OpenResult.new( :io => io, :is_reopen => true, :pos => Io.fsize( io ) ) else if ::File.exist?( path = gen_path ) raise EventFileExistsError, "File already exists: #{path}" else OpenResult.new( :io => ::File.open( path, "wb" ) ) end end end |