Method: Zip::ExtraField::NTFS#merge

Defined in:
lib/zip/extra_field/ntfs.rb

#merge(binstr) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/zip/extra_field/ntfs.rb', line 20

def merge(binstr)
  return if binstr.empty?
  size, content = initial_parse(binstr)
  (size && content) or return

  content = content[4..-1]
  tags = parse_tags(content)

  tag1 = tags[1]
  if tag1
    ntfs_mtime, ntfs_atime, ntfs_ctime = tag1.unpack("Q<Q<Q<")
    ntfs_mtime and @mtime ||= from_ntfs_time(ntfs_mtime)
    ntfs_atime and @atime ||= from_ntfs_time(ntfs_atime)
    ntfs_ctime and @ctime ||= from_ntfs_time(ntfs_ctime)
  end
end