Class | Archive::Tar::Minitar::Input |
In: |
lib/archive/tar/minitar.rb
|
Parent: | Object |
Wraps a Archive::Tar::Minitar::Reader with convenience methods and wrapped stream management; Input only works with random access data streams. See Input::new for details.
Creates a new Input object. If input is a stream object that responds to read), then it will simply be wrapped. Otherwise, one will be created and opened using Kernel#open. When Input#close is called, the stream object wrapped will be closed.
Iterates through each entry and rewinds to the beginning of the stream when finished.
Extracts the current entry to destdir. If a block is provided, it yields an action Symbol, the full name of the file being extracted (name), and a Hash of statistical information (stats).
The action will be one of:
:dir: | The entry is a directory. |
:file_start: | The entry is a file; the extract of the file is just beginning. |
:file_progress: | Yielded every 4096 bytes during the extract of the entry. |
:file_done: | Yielded when the entry is completed. |
The stats hash contains the following keys:
:current: | The current total number of bytes read in the entry. |
:currinc: | The current number of bytes read in this read cycle. |
:entry: | The entry being extracted; this is a Reader::EntryStream, with all methods thereof. |