tar Class
This class reads and writes Tape-Archive (TAR) Files and Gzip compressed TAR files, which are mainly used on UNIX systems. This class works on both windows AND unix systems, and does NOT rely on external applications!! Woohoo!
Methods | ||||
---|---|---|---|---|
public
|
__construct()
Class Constructor -- Does nothing...
Class Constructor -- Does nothing... |
# | ||
public
|
__computeUnsignedChecksum(string $bytestring): int|string
Computes the unsigned Checksum of a file's header
to try to ensure valid file
Computes the unsigned Checksum of a file's header to try to ensure valid file |
# | ||
public
|
__parseNullPaddedString(string $string): string
Converts a NULL padded string to a non-NULL padded string
Converts a NULL padded string to a non-NULL padded string |
# | ||
public
|
__parseTar(): bool
This function parses the current TAR file
This function parses the current TAR file Returnsalways TRUE |
# | ||
public
|
__readTar(string $filename = ''): bool
Read a non gzipped tar file in for processing.
Read a non gzipped tar file in for processing. Parameters
Returnsalways TRUE |
# | ||
public
|
__generateTar(): bool
Generates a TAR file from the processed data
Generates a TAR file from the processed data Returnsalways TRUE |
# | ||
public
|
openTAR(string $filename): bool
Open a TAR file
Open a TAR file |
# | ||
public
|
appendTar(string $filename): bool
Appends a tar file to the end of the currently opened tar file.
Appends a tar file to the end of the currently opened tar file. |
# | ||
public
|
getFile(string $filename): string|false
Retrieves information about a file in the current tar archive
Retrieves information about a file in the current tar archive ReturnsFALSE on fail |
# | ||
public
|
getDirectory(string $dirname): string|false
Retrieves information about a directory in the current tar archive
Retrieves information about a directory in the current tar archive ReturnsFALSE on fail |
# | ||
public
|
containsFile(string $filename): bool
Check if this tar archive contains a specific file
Check if this tar archive contains a specific file |
# | ||
public
|
containsDirectory(string $dirname): bool
Check if this tar archive contains a specific directory
Check if this tar archive contains a specific directory |
# | ||
public
|
addDirectory(string $dirname): bool
Add a directory to this tar archive
Add a directory to this tar archive |
# | ||
public
|
addFile(string $filename, boolean $binary = false): bool
Add a file to the tar archive
Add a file to the tar archive Parameters
|
# | ||
public
|
removeFile(string $filename): bool
Remove a file from the tar archive
Remove a file from the tar archive |
# | ||
public
|
removeDirectory(string $dirname): bool
Remove a directory from the tar archive
Remove a directory from the tar archive |
# | ||
public
|
saveTar(): bool
Write the currently loaded tar archive to disk
Write the currently loaded tar archive to disk |
# | ||
public
|
toTar(string $filename, bool $useGzip): bool
Saves tar archive to a different file than the current file
Saves tar archive to a different file than the current file Parameters
|
# | ||
public
|
toTarOutput(string $filename, bool $useGzip): string|false
Sends tar archive to stdout
Sends tar archive to stdout Parameters
|
# |
Properties | |||
---|---|---|---|
public
|
|
$filename
*#@+
Unprocessed Archive Information
*#@+ Unprocessed Archive Information |
# |
public
|
|
$isGzipped
|
# |
public
|
|
$tar_file
|
# |
public
|
|
$files
*#@+
Processed Archive Information
*#@+ Processed Archive Information |
# |
public
|
|
$directories
|
# |
public
|
|
$numFiles
|
# |
public
|
|
$numDirectories
|
# |