Info-ZIP Additional timestamp field
# File lib/zip/zip.rb, line 1690 def initialize(binstr = nil) @ctime = nil @mtime = nil @atime = nil @flag = nil binstr and merge(binstr) end
# File lib/zip/zip.rb, line 1709 def ==(other) @mtime == other.mtime && @atime == other.atime && @ctime == other.ctime end
# File lib/zip/zip.rb, line 1699 def merge(binstr) binstr == "" and return size, content = initial_parse(binstr) size or return @flag, mtime, atime, ctime = content.unpack("CVVV") mtime and @mtime ||= Time.at(mtime) atime and @atime ||= Time.at(atime) ctime and @ctime ||= Time.at(ctime) end
# File lib/zip/zip.rb, line 1723 def pack_for_c_dir s = [@flag].pack("C") @flag & 1 == 1 and s << [@mtime.to_i].pack("V") s end
# File lib/zip/zip.rb, line 1715 def pack_for_local s = [@flag].pack("C") @flag & 1 != 0 and s << [@mtime.to_i].pack("V") @flag & 2 != 0 and s << [@atime.to_i].pack("V") @flag & 4 != 0 and s << [@ctime.to_i].pack("V") s end