Module: Omnizip::Formats::Cpio::Constants

Included in:
Entry, Reader, Writer
Defined in:
lib/omnizip/formats/cpio/constants.rb

Overview

CPIO format constants

Defines magic numbers, file types, and format specifications for different CPIO archive formats.

Constant Summary collapse

MAGIC_BINARY =

Magic numbers for different CPIO formats

0o070707
MAGIC_ODC =

Old binary format

"070707"
MAGIC_NEWC =

Old portable ASCII format

"070701"
MAGIC_CRC =

New ASCII format (SVR4, most common)

"070702"
S_IFMT =

File type masks (from POSIX)

0o170000
S_IFSOCK =

File type mask

0o140000
S_IFLNK =

Socket

0o120000
S_IFREG =

Symbolic link

0o100000
S_IFBLK =

Regular file

0o060000
S_IFDIR =

Block device

0o040000
S_IFCHR =

Directory

0o020000
S_IFIFO =

Character device

0o010000
S_ISUID =

Permission bits

0o004000
S_ISGID =

Set UID bit

0o002000
S_ISVTX =

Set GID bit

0o001000
S_IRWXU =

Sticky bit

0o000700
S_IRUSR =

User permissions

0o000400
S_IWUSR =

User read

0o000200
S_IXUSR =

User write

0o000100
S_IRWXG =

User execute

0o000070
S_IRGRP =

Group permissions

0o000040
S_IWGRP =

Group read

0o000020
S_IXGRP =

Group write

0o000010
S_IRWXO =

Group execute

0o000007
S_IROTH =

Other permissions

0o000004
S_IWOTH =

Other read

0o000002
S_IXOTH =

Other write

0o000001
NEWC_HEADER_SIZE =

CPIO newc header size (110 bytes for newc format)

110
TRAILER_NAME =

Trailer entry name

"TRAILER!!!"
NEWC_ALIGNMENT =

Alignment for newc format (4 bytes)

4