Function __global->tar_get_directory
Definitions
sources/tar.php
- Return the root directory from the specified TAR file. Note that there are folders in here, and they will end '/'.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| &$resource | array | Yes | No | required parameter | N/A | N/A | The TAR file handle |
| $tolerate_errors | boolean | No | No | False | N/A | N/A | Whether to tolerate errors (returns null if error) |
Returns
- A list of maps that stores 'path', 'mode', 'size' and 'mtime', for each file in the archive (null: error)
- Type: ?array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Return the root directory from the specified TAR file. Note that there are folders in here, and they will end '/'.
*
* @param array $resource The TAR file handle
* @param boolean $tolerate_errors Whether to tolerate errors (returns null if error)
* @return ?array A list of maps that stores 'path', 'mode', 'size' and 'mtime', for each file in the archive (null: error)
*/
function tar_get_directory(array &$resource, bool $tolerate_errors = false) : ?array
* Return the root directory from the specified TAR file. Note that there are folders in here, and they will end '/'.
*
* @param array $resource The TAR file handle
* @param boolean $tolerate_errors Whether to tolerate errors (returns null if error)
* @return ?array A list of maps that stores 'path', 'mode', 'size' and 'mtime', for each file in the archive (null: error)
*/
function tar_get_directory(array &$resource, bool $tolerate_errors = false) : ?array

