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

This class represents a tar file that may be written to, but not queried.

Methods
append    close    create    new    new_entry    print    puts    transact    write   
Included modules
ParameterValidator
Public Class methods
create( filename, &block )

Open the given file in "write-only" mode. If a block is given, pass the new file to the block, execute the block, and then close the file. Otherwise, return the file.

append( filename, &block )

Open the given file in "write-only" mode, for appending. If a block is given, pass the new file to the block, execute the block, and then close the file. Otherwise, return the file.

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

Initialize a new write-only tar file reference. If ‘appending’ is true, then the file is opened for appending and the file pointer is moved to the end of the last valid block. If the file does not exist, it is created. If it does exist and the file is not opened for append, the file is truncated.

Public Instance methods
transact( &block )

Execute the given block using instance_eval

new_entry( filename, args={} )

Create a new entry with the given filename and arguments. Return the new entry.

write( s )

Write the given string to the current entry. If there is no current entry, raise an exception.

This method is also aliased as print
print( s )

Alias for write

puts( s="" )

Write the given string to the current entry, appending a newline.

close()

Close the current file, padding it out to a multiple of 20 blocks (the tar default).