class Crystar::Header

Defined in:

tar/header.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(flag : UInt8 = 0_u8, name : String = "", link_name : String = "", size : Int64 = 0_i64, mode : Int64 = 0_i64, uid : Int32 = 0, gid : Int32 = 0, uname : String = "", gname : String = "", mod_time : Time = Crystar.unix_time(0, 0), access_time : Time = Crystar.unix_time(0, 0), change_time : Time = Crystar.unix_time(0, 0), dev_major : Int64 = 0_i64, dev_minor : Int64 = 0_i64, xattr : Hash(String, String) = Hash(String, String).new, pax_records : Hash(String, String) = Hash(String, String).new, format : Crystar::Format = Format::None, io : IO = IO::Memory.new) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def access_time : Time #

[View source]
def access_time=(access_time : Time) #

[View source]
def change_time : Time #

[View source]
def change_time=(change_time : Time) #

[View source]
def dev_major : Int64 #

[View source]
def dev_major=(dev_major : Int64) #

[View source]
def dev_minor : Int64 #

[View source]
def dev_minor=(dev_minor : Int64) #

[View source]
def file_info #

file_info returns an File::Info for the header


[View source]
def flag : UInt8 #

Typeflag is the type of header entry. The zero value is automatically promoted to either REG or DIR depending on the presence of a trailing slash in Name.


[View source]
def flag=(flag : UInt8) #

Typeflag is the type of header entry. The zero value is automatically promoted to either REG or DIR depending on the presence of a trailing slash in Name.


[View source]
def flag=(v : Int) #

[View source]
def format : Format #

[View source]
def format=(format : Format) #

[View source]
def gid : Int32 #

[View source]
def gid=(gid : Int32) #

[View source]
def gid=(v : Int) #

[View source]
def gname : String #

[View source]
def gname=(gname : String) #

[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def io : IO #

[View source]
def link_name : String #

[View source]
def link_name=(link_name : String) #

[View source]
def mod_time : Time #

If the Format is unspecified, then Writer#write_header rounds mod_time to the nearest second and ignores the access_time and change_time fields.

To use access_time or change_time, specify the Format as PAX or GNU. To use sub-second resolution, specify the Format as PAX.


[View source]
def mod_time=(mod_time : Time) #

If the Format is unspecified, then Writer#write_header rounds mod_time to the nearest second and ignores the access_time and change_time fields.

To use access_time or change_time, specify the Format as PAX or GNU. To use sub-second resolution, specify the Format as PAX.


[View source]
def mode : Int64 #

[View source]
def mode=(mode : Int64) #

[View source]
def name : String #

[View source]
def name=(name : String) #

[View source]
def pax_records : Hash(String, String) #

pax_records is a map of PAX extended header records.

User-defined records should have keys of the following form: VENDOR.keyword Where VENDOR is some namespace in all uppercase, and keyword may not contain the '=' character (e.g., "CRYSTAL.mod.version"). The key and value should be non-empty UTF-8 strings.

When Writer#write_header is called, PAX records derived from the other fields in Header take precedence over PAXRecords.


[View source]
def pax_records=(pax_records : Hash(String, String)) #

pax_records is a map of PAX extended header records.

User-defined records should have keys of the following form: VENDOR.keyword Where VENDOR is some namespace in all uppercase, and keyword may not contain the '=' character (e.g., "CRYSTAL.mod.version"). The key and value should be non-empty UTF-8 strings.

When Writer#write_header is called, PAX records derived from the other fields in Header take precedence over PAXRecords.


[View source]
def size : Int64 #

[View source]
def size=(size : Int64) #

[View source]
def size=(v : Int) #

[View source]
def uid : Int32 #

[View source]
def uid=(uid : Int32) #

[View source]
def uid=(v : Int) #

[View source]
def uname : String #

[View source]
def uname=(uname : String) #

[View source]
def xattr : Hash(String, String) #

[View source]
def xattr=(xattr : Hash(String, String)) #

[View source]