class

ZipTricks::Writer

Inherits Reference < Object

Constants

CRZT_COMMENT = "Written using cr_zip_tricks v.#{ZipTricks::VERSION}"
EIGHT_BYTE_MAX_UINT = UInt64::MAX
FOUR_BYTE_MAX_UINT = UInt32::MAX
MADE_BY_SIGNATURE = Bytes[52, 3]

A combination of the VERSION_MADE_BY low byte and the OS type high byte VERSION_MADE_BY = 52 os_type = 3 # UNIX [VERSION_MADE_BY, os_type].pack('CC')

TWO_BYTE_MAX_UINT = UInt16::MAX
VERSION_NEEDED_TO_EXTRACT = 20
VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45

Instance methods

dir_external_attrs
Source
file_external_attrs
Source
write_central_directory_file_header(io : IO, filename : String, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32, gp_flags : ZipGpFlags, mtime : Time, storage_mode : ZipStorageMode, local_file_header_location : ZipLocation)
Source
write_data_descriptor(io : IO, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32)
Source
write_end_of_central_directory(io : IO, start_of_central_directory_location : ZipLocation, central_directory_size : ZipLocation, num_files_in_archive : ZipLocation, comment : String = CRZT_COMMENT)
Source
write_int32_le(io : IO, val : Int)
Source
write_local_file_header(io : IO, filename : String, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32, gp_flags : ZipGpFlags, mtime : Time, storage_mode : ZipStorageMode)
Source
write_timestamp_extra_field(io : IO, mtime : Time)

Writes the extended timestamp information field. The spec defines 2 different formats - the one for the local file header can also accomodate the atime and ctime, whereas the one for the central directory can only take the mtime - and refers the reader to the local header extra to obtain the remaining times

Source
write_uint16_le(io : IO, val : Int)
Source
write_uint32_le(io : IO, val : Int)
Source
write_uint64_le(io : IO, val : Int)
Source
write_uint8_le(io : IO, val : Int)
Source
write_zip64_extra_for_central_directory_file_header(io : IO, uncompressed_size : Int, compressed_size : Int, local_file_header_location : ZipLocation)
Source
write_zip64_extra_for_local_file_header(io : IO, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize)
Source

Nested types