file_size_to_tar_block_size (line 133)
Return the output from the conversion between filesize and TAR block size.
integer
file_size_to_tar_block_size
(integer $size)
-
integer
$size: The file size of a file that would be inside the TAR archive
tar_add_file (line 401)
Add a file to the specified TAR file.
void
tar_add_file
(array &$resource, PATH $target_path, string $data, integer $_mode, TIME $_mtime, [boolean $data_is_path = false])
-
array
&$resource: The TAR file handle
-
PATH
$target_path: The relative path to where we wish to add the file to the archive (including filename)
-
string
$data: The data of the file to add
-
integer
$_mode: The file mode (permissions)
-
TIME
$_mtime: The modification time we wish for our file
-
boolean
$data_is_path: Whether the $data variable is actually a full file path
tar_add_folder (line 213)
Add a folder to the TAR archive
void
tar_add_folder
(array &$resource, resource $logfile, PATH $path, [?integer $max_size = NULL], [PATH $subpath = ''], [?array $avoid_backing_up = NULL], [?array $root_only_dirs = NULL], [boolean $tick = false], [boolean $all_files = false])
-
array
&$resource: The TAR file handle
-
resource
$logfile: The logfile to write to
-
PATH
$path: The full path to the folder to add
-
?integer
$max_size: The maximum file size to add (NULL: no limit)
-
PATH
$subpath: The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
-
?array
$avoid_backing_up: A map (filename=>1) of files to not back up (NULL: none)
-
?array
$root_only_dirs: A list of directories ONLY to back up from the root (NULL: no restriction)
-
boolean
$tick: Whether to output spaces as we go to keep the connection alive
-
boolean
$all_files: Whether to not skip "special files" (ones not normally archive)
tar_add_folder_incremental (line 150)
Add a folder to the TAR archive, however only store files modifed after a threshold time. It is incremental (incremental backup), by comparing against a threshold before adding a file (threshold being time of last backup)
array
tar_add_folder_incremental
(array &$resource, resource $logfile, PATH $path, TIME $threshold, ?integer $max_size, [PATH $subpath = ''], [boolean $all_files = false])
-
array
&$resource: The TAR file handle
-
resource
$logfile: The logfile to write to
-
PATH
$path: The full path to the folder to add
-
TIME
$threshold: The threshold time
-
?integer
$max_size: The maximum file size to add (NULL: no limit)
-
PATH
$subpath: The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
-
boolean
$all_files: Whether to not skip "special files" (ones not normally archive)
tar_close (line 509)
Close an open TAR resource.
void
tar_close
(array $resource)
-
array
$resource: The TAR file handle to close
tar_crc (line 493)
Find the checksum specified in a TAR header
integer
tar_crc
(string $header)
-
string
$header: The header from a TAR file
tar_extract_to_folder (line 263)
Extract all the files in the specified TAR file to the specified path.
void
tar_extract_to_folder
(array &$resource, PATH $path, [boolean $use_afm = false], [?array $files = NULL], [boolean $comcode_backups = false])
-
array
&$resource: The TAR file handle
-
PATH
$path: The full path to the folder to extract to
-
boolean
$use_afm: Whether to extract via the AFM (assumes AFM has been set up prior to this function call)
-
?array
$files: The files to extract (NULL: all)
-
boolean
$comcode_backups: Whether to take backups of Comcode pages
tar_get_directory (line 62)
Return the root directory from the specified TAR file. Note that there are folders in here, and they will end '/'.
?array
tar_get_directory
(array &$resource, [boolean $tolerate_errors = false])
-
array
&$resource: The TAR file handle
-
boolean
$tolerate_errors: Whether to tolerate errors (returns NULL if error)
tar_get_file (line 357)
Get the contents of the specified file in the specified TAR.
?array
tar_get_file
(array &$resource, PATH $path, [boolean $tolerate_errors = false])
-
array
&$resource: The TAR file handle
-
PATH
$path: The full path to the file we want to get
-
boolean
$tolerate_errors: Whether to tolerate errors (returns NULL if error)
tar_open (line 29)
Open up a TAR archive, and return the resource.
array
tar_open
(PATH $path, string $mode)
-
PATH
$path: The path to the TAR archive
-
string
$mode: The mode to open the TAR archive (rb=read, wb=write)