Class TapeArchive::RecordHeader
In: tar.rb
Parent: Object

This class represents the header record for a single tar entry. It is also used to represent an "empty block", which pads the end of a tar file. This class should almost never be instantiated directly.

Methods
compute_checksum    from_stream    make_nil    new    nil?    padding    to_oct    to_s   
Attributes
chksum  [RW] 
devmajor  [RW] 
devminor  [RW] 
gid  [RW] 
gname  [RW] 
linkflag  [RW] 
linkname  [RW] 
magic  [RW] 
mode  [RW] 
mtime  [RW] 
name  [RW] 
prefix  [RW] 
size  [RW] 
uid  [RW] 
uname  [RW] 
version  [RW] 
Included modules
ParameterValidator
Public Class methods
make_nil()

Instantiate an empty header record, composed entirely of null bytes.

from_stream( stream )

Read the record header from the given stream and instantiate it.

new( args={} )

Instantiate a new record header from the given keyword arguments.

padding( size )

Compute the extra padding needed to bring a block of size ‘size’ to RECORD_SIZE bytes.

Public Instance methods
nil?()

Query whether this header is nil.

to_s( checksumming=false )

Convert the header to its string value, which will be written to a file. If checksumming is true, then the chksum field will be left blank so that a checksum can be computed.

compute_checksum()

Compute the checksum for this header.

to_oct( n, s=0 )

A convenience function for converting a number to octal, with the given width (padded with 0’s).