Object
EntryStreams are pseudo-streams on top of the main data stream.
# File lib/archive/tar/minitar.rb, line 464 464: def initialize(header, anIO) 465: @io = anIO 466: @name = header.name 467: @mode = header.mode 468: @uid = header.uid 469: @gid = header.gid 470: @size = header.size 471: @mtime = header.mtime 472: @checksum = header.checksum 473: @typeflag = header.typeflag 474: @linkname = header.linkname 475: @magic = header.magic 476: @version = header.version 477: @uname = header.uname 478: @gname = header.gname 479: @devmajor = header.devmajor 480: @devminor = header.devminor 481: @prefix = header.prefix 482: @read = 0 483: @orig_pos = @io.pos 484: end
# File lib/archive/tar/minitar.rb, line 536 536: def bytes_read 537: @read 538: end
Closes the entry.
# File lib/archive/tar/minitar.rb, line 550 550: def close 551: invalidate 552: end
Returns true if the entry represents a directory.
# File lib/archive/tar/minitar.rb, line 507 507: def directory? 508: @typeflag == "5" 509: end
Returns true if the current read pointer is at the end of the EntryStream data.
# File lib/archive/tar/minitar.rb, line 520 520: def eof? 521: @read >= @size 522: end
Returns true if the entry represents a plain file.
# File lib/archive/tar/minitar.rb, line 513 513: def file? 514: @typeflag == "0" 515: end
Returns the full and proper name of the entry.
# File lib/archive/tar/minitar.rb, line 541 541: def full_name 542: if @prefix != "" 543: File.join(@prefix, @name) 544: else 545: @name 546: end 547: end
Reads one byte from the entry. Returns nil if there is no more data to read.
# File lib/archive/tar/minitar.rb, line 499 499: def getc 500: return nil if @read >= @size 501: ret = @io.getc 502: @read += 1 if ret 503: ret 504: end
Returns the current read pointer in the EntryStream.
# File lib/archive/tar/minitar.rb, line 525 525: def pos 526: @read 527: end
Reads len bytes (or all remaining data) from the entry. Returns nil if there is no more data to read.
# File lib/archive/tar/minitar.rb, line 488 488: def read(len = nil) 489: return nil if @read >= @size 490: len ||= @size - @read 491: max_read = [len, @size - @read].min 492: ret = @io.read(max_read) 493: @read += ret.size 494: ret 495: end
Sets the current read pointer to the beginning of the EntryStream.
# File lib/archive/tar/minitar.rb, line 530 530: def rewind 531: raise NonSeekableStream unless @io.respond_to?(:pos=) 532: @io.pos = @orig_pos 533: @read = 0 534: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.