unpack - expand files (LEGACY)
unpack file...
The unpack utility replaces files in the format used by pack with their unpacked form. For each file file operand, a search is made for a file called file.z (or just file, if file ends in .z). If this file appears to be a packed file, it is replaced by its expanded version. The new file has the .z stripped from its name. If the invoking process has appropriate privileges, the ownership, modes, access time, and modification time of the original file are preserved.A file is not unpacked if one of the following is true:
- The filename (exclusive of the .z) has more than {NAME_MAX} bytes.
- The file cannot be opened.
- The file does not appear to be the output of pack.
- A file with the unpacked name already exists.
- The unpacked file cannot be created.
None.
The following operand is supported:
- file
- A pathname of a file to be unpacked; file can include or omit the .z suffix.
Not used.
The input files are regular files in the format created by pack.
The following environment variables may affect the execution of pack:
- LANG
- Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
- LC_ALL
- If set to a non-empty string value, override the values of all the other internationalisation variables.
- LC_CTYPE
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
- LC_MESSAGES
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error, and informative messages written to standard output.
- NLSPATH
- Determine the location of message catalogues for the processing of LC_MESSAGES .
If an error occurs, the $(basename file .z) file is not created and the original file is unchanged.
The standard output is a text file containing one line for each file unpacked, with the following format in the POSIX locale:
"unpack: %s: unpacked\n", file
Used only for diagnostic messages.
Files equivalent to the original unpacked file are created with the names as though $(basename file .z). were invoked corresponding to each file operand.
None.
The following exit values are returned:
- 0
- Successful completion.
- >0
- An error occurred.
Default.
Applications should migrate to the uncompress utility.
None.
None.
pack, pcat, uncompress.