Class | Zip::ZipExtraField::UniversalTime |
In: |
lib/zip/zip.rb
|
Parent: | Generic |
Info-ZIP Additional timestamp field
HEADER_ID | = | "UT" |
atime | [RW] | |
ctime | [RW] | |
flag | [RW] | |
mtime | [RW] |
# File lib/zip/zip.rb, line 1717 def initialize(binstr = nil) @ctime = nil @mtime = nil @atime = nil @flag = nil binstr and merge(binstr) end
# File lib/zip/zip.rb, line 1736 def ==(other) @mtime == other.mtime && @atime == other.atime && @ctime == other.ctime end
# File lib/zip/zip.rb, line 1726 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 1750 def pack_for_c_dir s = [@flag].pack("C") @flag & 1 == 1 and s << [@mtime.to_i].pack("V") s end