Friedrich-Alexander-Universität Erlangen-Nürnberg  /   Technische Fakultät  /   Department Informatik

File Entry. More...

#include <utils/tar.h>

Public Member Functions

uint64_t getSize ()
 Get file size. More...
 
bool isUstar ()
 Entry with Ustar extension? More...
 
bool isValid ()
 Valid checksum? More...
 
void * getData ()
 Get pointer to file data. More...
 
Filenext ()
 Get a pointer to the next file entry. More...
 

Public Attributes

char name [100]
 File name ('\0' terminated string)
 
char mode [8]
 Permission bits (octal characters)
 
char uid [8]
 User ID (octal characters)
 
char gid [8]
 Group ID (octal characters)
 
char size [12]
 File size (octal characters)
 
char mtime [12]
 Timestamp of last modification (octal characters)
 
char checksum [8]
 check sum (octal characters)
 
Type type
 File type.
 
char link [100]
 File name with identical content for TYPE_HARD_LINK.
 
char magic [8]
 Magic header "ustar".
 
char user [32]
 User.
 
char group [32]
 Group.
 
char majordevid [8]
 Major device ID.
 
char minordevid [8]
 Minor device ID.
 
char prefix [155]
 File prefix.
 
char padding [12]
 Padding (unused)
 
char data []
 File contents with size bytes, 512 bytes aligned.
 

Detailed Description

File Entry.

Contains 512 bytes of meta information as well as the content of the file with a variable size (512 bytes aligned).

Numbers are encoded as zero-filled octal numbers in ASCII characters.

Member Function Documentation

◆ getSize()

uint64_t Tar::File::getSize ( )

Get file size.

Returns
Size of actual file (without padding)

◆ isUstar()

bool Tar::File::isUstar ( )

Entry with Ustar extension?

Returns
'true' if entry uses the extension

◆ isValid()

bool Tar::File::isValid ( )

Valid checksum?

Returns
'true' if header has a correct checksum

◆ getData()

void * Tar::File::getData ( )

Get pointer to file data.

Returns
Pointer to file data (use getSize() for length)

◆ next()

Tar::File * Tar::File::next ( )

Get a pointer to the next file entry.

Returns
Pointer to next file entry or 'nullptr' if there is none.

The documentation for this struct was generated from the following files:
  • utils/tar.h
  • utils/tar.cc