Archive_Tar::listContent()

Archive_Tar::listContent() -- list files and directories in archive

Synopsis

require_once 'Archive/Tar.php';

array listContent ()

Description

Lists the files and the directories of the archive.

Return value

array - each array entry represents a file or folder. The array is not sorted, so the index shows the position of the file or directory in the archive.

Each entry contains the following information:

Throws

Table 38-1. Possible PEAR_Error values

Error codeError messageReasonSolution
NULL " Unable to open in read mode archive " The file is exclusively locked by another application. Check for other applications working on the file. This can not be caused by a competive processing the archive with Archive_Tar
NULL " Invalid listcontent mode mode " Implementation error Should not occur, please set up a bug report.
NULL " Directory name already exists as a file " A file is marked up as directory in the archive. Maybe a corrupted archive.
NULL " File name already exists as a directory " A directoy is marked up as file in the archive. Maybe a corrupted archive.
NULL " File name already exists and is write protected. " The archive contains a file which already exists in the destination dir and can not be overwritten. Extract the archive to an empty directory.
NULL " Unable to create path for name " One or more new nested directories could not be created in the destination directory. Ensure the destination directory and all nested directories have the required rights.
NULL " Unable to create directory name " A directory could not be created in the destination directory. Ensure the destination directory has the required rights.
NULL " Error while opening name in write binary mode " The file could not be created. The file is maybe locked.
NULL " Extracted file filename does not have the correct file size filesize (size expected). Archive may be corrupted. " Read the message. Read the message.

Note

This function can not be called statically.

Example