class Zip::ZipExtraField::UniversalTime
Info-ZIP Additional timestamp field
Constants
- HEADER_ID
Attributes
atime[RW]
ctime[RW]
flag[RW]
mtime[RW]
Public Class Methods
new(binstr = nil)
click to toggle source
# File lib/zip/zip.rb, line 1683 def initialize(binstr = nil) @ctime = nil @mtime = nil @atime = nil @flag = nil binstr and merge(binstr) end
Public Instance Methods
==(other)
click to toggle source
# File lib/zip/zip.rb, line 1702 def ==(other) @mtime == other.mtime && @atime == other.atime && @ctime == other.ctime end
merge(binstr)
click to toggle source
# File lib/zip/zip.rb, line 1692 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
pack_for_c_dir()
click to toggle source
# File lib/zip/zip.rb, line 1716 def pack_for_c_dir s = [@flag].pack("C") @flag & 1 == 1 and s << [@mtime.to_i].pack("V") s end
pack_for_local()
click to toggle source
# File lib/zip/zip.rb, line 1708 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