module Zip # PKWARE NTFS Extra Field (0x000a) # Only Tag 0x0001 is supported class ExtraField::NTFS < ExtraField::Generic HEADER_ID = [0x000A].pack('v') register_map WINDOWS_TICK = 10_000_000.0 SEC_TO_UNIX_EPOCH = 11_644_473_600 def initialize(binstr = nil) @ctime = nil @mtime = nil @atime = nil binstr && merge(binstr) end attr_accessor :atime, :ctime, :mtime def merge(binstr) return if binstr.empty? size, content = initial_parse(binstr) (size && content) || return content = content[4..-1] tags = parse_tags(content) tag1 = tags[1] return unless tag1 ntfs_mtime, ntfs_atime, ntfs_ctime = tag1.unpack('Q