class Rex::Zip::CompFlags

This structure holds the following data pertaining to a Zip entry.

general purpose bit flag compression method modification time modification date

Attributes

compmeth[RW]

Public Class Methods

new(gpbf, compmeth, timestamp) click to toggle source
# File lib/rex/zip/blocks.rb, line 38
def initialize(gpbf, compmeth, timestamp)
  @gpbf = gpbf
  @compmeth = compmeth
  @mod_time = ((timestamp.hour << 11) | (timestamp.min << 5) | (timestamp.sec))
  @mod_date = (((timestamp.year - 1980) << 9) | (timestamp.mon << 5) | (timestamp.day))
end

Public Instance Methods

pack() click to toggle source
# File lib/rex/zip/blocks.rb, line 45
def pack
  [ @gpbf, @compmeth, @mod_time, @mod_date ].pack('vvvv')
end