Class: RangesIONonResizeable

Inherits:
RangesIO show all
Defined in:
lib/ole/ranges_io.rb

Overview

this subclass of ranges io explicitly ignores the truncate part of ‘w’ modes. only really needed for the allocation table writes etc. maybe just use explicit modes for those better yet write a test that breaks before I fix it. added nodoc for the time being.

Instance Attribute Summary

Attributes inherited from RangesIO

#io, #mode, #pos, #ranges, #size

Instance Method Summary collapse

Methods inherited from RangesIO

#close, #eof?, #gets, #inspect, open, #read, #rewind, #truncate, #write

Constructor Details

#initialize(io, mode = 'r', params = {}) ⇒ RangesIONonResizeable

:nodoc:



261
262
263
264
265
# File 'lib/ole/ranges_io.rb', line 261

def initialize io, mode='r', params={}
	mode, params = 'r', mode if Hash === mode
	flags = Ole::IOMode.new(mode).flags & ~IO::TRUNC
	super io, flags, params
end