Archive: ezcArchiveV7Tar
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcArchiveV7Tar
|
The ezcArchiveV7Tar class implements the Tar v7 archive format. [
source]
ezcArchiveV7Tar is a subclass from
ezcArchive that provides the common interface. Tar v7 algorithm specific methods are implemented in this class.
ezcArchiveV7Tar reads on creation only the first
ezcArchiveEntry from the archive. When needed next entries are read.
The V7 Tar algorithm is most basic implementation of Tar. This format has the following characteristics:
- Filenames up to 100 characters.
- Stores the file permissions.
- Stores the owner and group by ID.
- Stores the last modification time.
- Can archive: regular files and symbolic links.
- Maximum file size: 8 Gygabyte.
Parents
ezcArchive
|
--ezcArchiveV7Tar
Descendents
| Child Class |
Description |
| ezcArchiveUstarTar |
The ezcArchiveUstarTar class implements the Tar ustar archive format.
|
Constants
Inherited Constants
From
ezcArchive:
Member Variables
|
protected int |
$blockFactor
= 20
Tar archives have always $blockFactor of blocks. |
|
protected array(int) |
$headerPositions
Stores the block number where the header starts. |
|
protected array(ezcArchiveV7Header) |
$headers
Stores all the headers from the archive. |
Inherited Member Variables
From
ezcArchive:
Method Summary
Inherited Methods
From
ezcArchive :
Methods
__construct
ezcArchiveV7Tar __construct(
$file, [int
$blockFactor = 20] )
Initializes the Tar and tries to read the first entry from the archive.
At initialization it sets the blockFactor to $blockFactor. Each tar archive has always $blockFactor of blocks ( 0, $blockFactor, 2 * $blockFactor, etc ).
The Tar archive works with blocks, so therefore the first parameter expects the archive as a blockFile.
Parameters
| Name |
Type |
Description |
$file |
ezcArchiveBlockFile |
|
$blockFactor |
int |
|
Redefined in descendants as
algorithmCanWrite
void algorithmCanWrite(
)
Redefinition of
Redefined in descendants as
appendHeaderAndFileToCurrent
void appendHeaderAndFileToCurrent(
string
$file,
ezcArchiveEntry
$entry, bool
$appendNullBlocks )
Appends the given ezcArchiveBlockFile $file and
ezcArchiveEntry $entry to the archive file.
The $entry will be used to create the correct header, whereas the $file contains the raw data that should be append to the archive.
$appendNullBlocks specifies whether or not null blocks should be appended to the end of the archive. These null blocks will give the archive exactly a @blockFactor size.
Parameters
| Name |
Type |
Description |
$file |
string |
|
$entry |
ezcArchiveEntry |
|
$appendNullBlocks |
bool |
|
appendNullBlocks
void appendNullBlocks(
)
Appends zero or more null blocks to the end of the archive, so that it matches the $blockFactor.
If the archive has already the correct size, no null blocks will be appended. Otherwise as many null blocks are appended (up to $blockFactor - 1) so that it matches the $blockFactor.
appendToCurrent
void appendToCurrent(
$files,
$prefix, [
$appendNullBlocks = true] )
Parameters
| Name |
Type |
Description |
$files |
|
|
$prefix |
|
|
$appendNullBlocks |
|
|
Redefinition of
createTarHeader
ezcArchiveV7Header createTarHeader(
[mixed
$file = null] )
Creates the a new tar header for this class.
Usually this class is reimplemented by other Tar algorithms, and therefore it returns another Tar header.
This method expects an ezcArchiveBlockFile that points to the header that should be read (and created). If null is given as block file, an empty header will be created.
Redefined in descendants as
getAlgorithm
void getAlgorithm(
)
Redefinition of
Redefined in descendants as
readCurrentFromArchive
void readCurrentFromArchive(
)
Read the current entry from the archive.
The current entry from the archive is read, if possible. This method will set the
$completed to true, if the end of the archive is reached. The
$entriesRead will be increased, if the entry is correctly read.
truncate
void truncate(
[
$fileNumber = 0], [
$appendNullBlocks = true] )
Parameters
| Name |
Type |
Description |
$fileNumber |
|
|
$appendNullBlocks |
|
|
Redefinition of
writeCurrentDataToFile
void writeCurrentDataToFile(
$targetPath )
Parameters
| Name |
Type |
Description |
$targetPath |
|
|
Redefinition of
Last updated: Wed, 28 Nov 2007