Class TapeArchive::File::ReadOnlyFile
In: tar.rb
Parent: File

Represents a read-only tar file, which may be queried but not modified.

Methods
[]    each_entry    entries    new    next_entry    open    read   
Public Class methods
open( filename, &block )

Open an existing tar file with the given filename. If the block is given, execute the block (passing the new file to it) and then close the file. Otherwise, return the file.

new( filename, &block ) {|self| ...}

Initialize a newly opened tar file.

Public Instance methods
next_entry()

Return the next entry in the tar file, or nil if there are no more entries.

each_entry() {|e| ...}

Execute the attached block for each entry in the tar file.

read( num=nil )

Read the given number of bytes from the current entry. If num is nil, then read the entire contents of the current entry. If there is no current entry, this throws an exception.

[]( entry )

Search the archive for the entry with the given name. Returns nil if the named entry could not be found.

entries()

Return an array of all entries in the archive. The array is not guaranteed to list the entries in the same order as they existed in the archive. It is safe to call next_entry after this, to continue an iteration that was previously active.