Class | Ole::Storage |
In: |
lib/ole/storage/meta_data.rb
lib/ole/storage/version.rb lib/ole/storage/base.rb lib/ole/storage/file_system.rb |
Parent: | Object |
This class is the primary way the user interacts with an OLE storage file.
VERSION | = | '1.2.11.2' |
bbat | [R] | Low level internals, you probably shouldn‘t need to mess with these |
close_parent | [R] | The underlying io object to/from which the ole object is serialized, whether we should close it, and whether it is writeable |
dirents | [R] | The tree structure in its original flattened form. only valid after load, or flush. |
header | [R] | Low level internals, you probably shouldn‘t need to mess with these |
io | [R] | The underlying io object to/from which the ole object is serialized, whether we should close it, and whether it is writeable |
params | [R] | options used at creation time |
root | [R] | The top of the ole tree structure |
sb_file | [R] | Low level internals, you probably shouldn‘t need to mess with these |
sbat | [R] | Low level internals, you probably shouldn‘t need to mess with these |
writeable | [R] | The underlying io object to/from which the ole object is serialized, whether we should close it, and whether it is writeable |
arg should be either a filename, or an IO object, and needs to be seekable. mode is optional, and should be a regular mode string.
somewhat similar to File.open, the open class method allows a block form where the Ole::Storage object is automatically closed on completion of the block.
the flush method is the main "save" method. all file contents are always written directly to the file by the RangesIO objects, all this method does is write out all the file meta data - dirents, allocation tables, file header etc.
maybe add an option to zero the padding, and any remaining avail blocks in the allocation table.
TODO: long and overly complex. simplify and test better. eg, perhaps move serialization of bbat to AllocationTable::Big.
TODO: implement various allocationtable checks, maybe as a AllocationTable#fsck function :)