My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

ruby-ole is a library for read/write access to OLE2 structured storage files, such as those produced by Microsoft Office, eg *.doc, *.msg etc.

It provides a simple and easy to use api, supporting read and write streaming, by providing transparent access to the "files" within OLE documents as IO-like objects, supporting all the expected operations.

A sample command line utility (oletool) is included which showcases some of the library functionality.

Usage is very easy, thanks to an api modeled after zip/zipfilesystem:

require 'ole/storage'

Ole::Storage.open 'someolefile.doc' do |ole|
  p ole.dir.pwd # => "/"
  ole.file.read("/\001CompObj")
  ole.dir.open '/' do |dir|
    ole.file.open(dir.read) { |f| f.write "blah blah" }
    ole.file.rename 'blah', 'blah'
  end
end
Powered by Google Project Hosting