Function __global->tar_open
Definitions
sources/tar.php
- Open up a TAR archive (or tarball if the zlib extension is available and .gz is requested), and return the resource.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $path | PATH | No | No | required parameter | N/A | N/A | The path to the TAR archive; for a write operation can be php://output given TAR is a streamable format |
| $mode | string | No | No | required parameter | rb wb c+b | N/A | The mode to open the TAR archive (rb=read, wb=write) |
| $known_exists | boolean | No | No | False | N/A | N/A | Whether we know the file currently exists (performance optimisation) |
| $real_filename | ?string | No | No | Null | N/A | N/A | The real filename of the TAR file (null: derive from $path) |
Returns
- The TAR file handle
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Open up a TAR archive (or tarball if the zlib extension is available and .gz is requested), and return the resource.
*
* @param PATH $path The path to the TAR archive; for a write operation can be php://output given TAR is a streamable format
* @param string $mode The mode to open the TAR archive (rb=read, wb=write)
* @set rb wb c+b
* @param boolean $known_exists Whether we know the file currently exists (performance optimisation)
* @param ?string $real_filename The real filename of the TAR file (null: derive from $path)
* @return array The TAR file handle
*/
function tar_open(string $path, string $mode, bool $known_exists = false, ?string $real_filename = null) : array
* Open up a TAR archive (or tarball if the zlib extension is available and .gz is requested), and return the resource.
*
* @param PATH $path The path to the TAR archive; for a write operation can be php://output given TAR is a streamable format
* @param string $mode The mode to open the TAR archive (rb=read, wb=write)
* @set rb wb c+b
* @param boolean $known_exists Whether we know the file currently exists (performance optimisation)
* @param ?string $real_filename The real filename of the TAR file (null: derive from $path)
* @return array The TAR file handle
*/
function tar_open(string $path, string $mode, bool $known_exists = false, ?string $real_filename = null) : array

