Class | Archive::Tar::Minitar::Writer |
In: |
lib/archive/tar/minitar.rb
|
Parent: | Object |
The class that writes a tar format archive to a data stream.
With no associated block, +Writer::open+ is a synonym for +Writer::new+. If the optional code block is given, it will be passed the new writer as an argument and the Writer object will automatically be closed when the block terminates. In this instance, +Writer::open+ returns the value of the block.
Adds a file to the archive as name. opts must contain the following value:
:mode: | The Unix file permissions mode value. |
opts may contain the following values:
:uid: The Unix file owner user ID number. :gid: The Unix file owner group ID number.
:mtime: | The integer modification time value. |
The file‘s size will be determined from the amount of data written to the stream.
For add_file to be used, the Archive::Tar::Minitar::Writer must be wrapping a stream object that is seekable (e.g., it responds to pos=). Otherwise, add_file_simple must be used.
opts may be modified during the writing to the stream.
Adds a file to the archive as name. opts must contain the following values:
:mode: | The Unix file permissions mode value. |
:size: | The size, in bytes. |
opts may contain the following values:
:uid: The Unix file owner user ID number. :gid: The Unix file owner group ID number.
:mtime: | The integer modification time value. |
It will not be possible to add more than opts[:size] bytes to the file.