Zip::ZipExtraField::IUnix

Info-ZIP Extra for UNIX uid/gid

Constants

HEADER_ID

Attributes

gid[RW]
uid[RW]

Public Class Methods

new(binstr = nil) click to toggle source
# File lib/zip/zip_extra_field.rb, line 98
def initialize(binstr = nil)
  @uid = 0
  @gid = 0
  binstr and merge(binstr)
end

Public Instance Methods

==(other) click to toggle source
# File lib/zip/zip_extra_field.rb, line 115
def ==(other)
  @uid == other.uid &&
  @gid == other.gid
end
merge(binstr) click to toggle source
# File lib/zip/zip_extra_field.rb, line 105
def merge(binstr)
  return if binstr.empty?
  size, content = initial_parse(binstr)
  # size: 0 for central directory. 4 for local header
  return if(!size || size == 0)
  uid, gid = content.unpack("vv")
  @uid ||= uid
  @gid ||= gid
end
pack_for_c_dir() click to toggle source
# File lib/zip/zip_extra_field.rb, line 124
def pack_for_c_dir
  ""
end
pack_for_local() click to toggle source
# File lib/zip/zip_extra_field.rb, line 120
def pack_for_local
  [@uid, @gid].pack("vv")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.