class Zip::ExtraField::OldUnix
Olf Info-ZIP Extra for UNIX uid/gid and file timestampes
def ==(other)
def ==(other) @uid == other.uid && @gid == other.gid && @atime == other.atime && @mtime == other.mtime end
def initialize(binstr = nil)
def initialize(binstr = nil) @uid = 0 @gid = 0 @atime = nil @mtime = nil binstr && merge(binstr) end
def merge(binstr)
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 atime, mtime, uid, gid = content.unpack('VVvv') @uid ||= uid @gid ||= gid @atime ||= atime @mtime ||= mtime # rubocop:disable Naming/MemoizedInstanceVariableName end
def pack_for_c_dir
def pack_for_c_dir [@atime, @mtime].pack('VV') end
def pack_for_local
def pack_for_local [@atime, @mtime, @uid, @gid].pack('VVvv') end