class RPM::File::Lead

Attributes

archnum[RW]
length[RW]

}

magic[RW]

struct rpmlead {

major[RW]
minor[RW]
name[RW]
osnum[RW]
reserved[RW]
signature_type[RW]
type[RW]

Public Class Methods

new(file) click to toggle source
# File lib/arr-pm/file/lead.rb, line 19
def initialize(file)
  @file = file
  @inspectables = [:@major, :@minor, :@length, :@type, :@archnum, :@signature_type, :@reserved, :@osnum]
end

Public Instance Methods

read() click to toggle source
# File lib/arr-pm/file/lead.rb, line 35
def read
  # Use 'A' here instead of 'a' to trim nulls.
  @length = 96
  data = @file.read(@length).unpack("A4CCnnA66nnA16")
  @magic, @major, @minor, @type, @archnum, @name, \
    @osnum, @signature_type, @reserved = data

  return nil
end
write(file) click to toggle source
# File lib/arr-pm/file/lead.rb, line 45
def write(file)
  data = [ @magic, @major, @minor, @type, @archnum, @name, \
           @osnum, @signature_type, @reserved ].pack("a4CCnna66nna16")
  file.write(data)
end