class Crystar::Header

Defined in:

tar/header.cr

Constructors

Instance Method Summary

Constructor Detail

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

[View source]

Instance Method Detail

def ==(other : self) #

def access_time : Time #

Modification time


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

Modification time


[View source]
def change_time : Time #

Access time (requires either PAX or GNU support)


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

Access time (requires either PAX or GNU support)


[View source]
def dev_major : Int64 #

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

[View source]
def dev_minor : Int64 #

Major device number (valid for CHAR or BLOCK)


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

Major device number (valid for CHAR or BLOCK)


[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 TypeReg or TypeDir 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 TypeReg or TypeDir 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 #

User ID of owner


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

User ID of owner


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

[View source]
def gname : String #

User name of owner


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

User name of owner


[View source]
def hash(hasher) #

def io : IO #

[View source]
def link_name : String #

Name of file entry


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

Name of file entry


[View source]
def mod_time : Time #

If the Format is unspecified, then Writer.WriteHeader rounds ModTime to the nearest second and ignores the AccessTime and ChangeTime fields.

To use AccessTime or ChangeTime, 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.WriteHeader rounds ModTime to the nearest second and ignores the AccessTime and ChangeTime fields.

To use AccessTime or ChangeTime, specify the Format as PAX or GNU. To use sub-second resolution, specify the Format as PAX.


[View source]
def mode : Int64 #

Logical file size in bytes


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

Logical file size in bytes


[View source]
def name : String #

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

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

PAXRecords 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., "GOLANG.pkg.version"). The key and value should be non-empty UTF-8 strings.

When Writer.WriteHeader 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)) #

PAXRecords 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., "GOLANG.pkg.version"). The key and value should be non-empty UTF-8 strings.

When Writer.WriteHeader 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 #

Permission and mode bits


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

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

Permission and mode bits


[View source]
def uname : String #

Group ID of owner


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

Group ID of owner


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

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

[View source]