0

Instead of using non-POSIX tools such as unxz, what POSIX utility can I use to decompress files with the .xz extension?

Neither xz nor unxz is a POSIX command, so if I want to run only POSIX commands, what POSIX command can I run to uncompress an .xz file?

2 Answers 2

3

POSIX is a minimum standard for commands and APIs so that programs can be written that will correctly run on on a POSIX compliant system.

POSIX says what your system MUST have, it doesn't say anything about what other things can be added to it.

A program doesn't need to be mentioned in POSIX for it to run on a POSIX system. For a random program (not mentioned in POSIX), it is posix compliant if it uses POSIX APIs to run.

If POSIX doesn't mention the "xz" compression method, then there IS NOT a "posix utility" to handle that file format. There is nothing wrong with using the existing xz and unxz tools and it is pretty much your only option.

1
  • 1
    pixz or libarchive's bsdcat are other options to uncompress xz data. Commented Feb 27, 2023 at 14:31
2

xz. POSIX is an interface standard, not a compliance standard. The existing xz tools are POSIX compliant in that they accept input and produce output to the POSIX standards, and rely only on POSIX APIs.

Yes, xz is POSIX-compliant. POSIX specification only mentions required 'UNIX'-core utilities, it is not a list of all POSIX-compliant software.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.