Hi, I am new to C programing so I can't figure out how to actually use xzminidec. I compiled it and when I run ./xzminidec test.tar.xz or ./xzminidec test.tar.xz test nothing happens as the program "thinks for ever". How is it intended to be used? I build test.tar.xz with tar cf test.tar test ; xz --check=crc32 test.tar.
./xzminidec test.tar.xz test
tar cf test.tar test ; xz --check=crc32 test.tar
xzminidec reads from stdin and writes to stdout so you should do something like this: ./xzminidec < test.tar.xz | tar xf -
xzminidec understands --help argument but ignores everything else. Ignoring the arguments can help if you are replacing xz with xzminidec when using scripts that run xz -dc, but otherwise it's probably a bit confusing behavior.
xzminidec is primarily a demo program meant to be useful for programmers who plan to use XZ Embedded. Especially the lack of support for concatenated .xz streams can be a problem that isn't immediately obvious but can bite with some real-world files (xzminidec silently ignores the streams after the first stream). Using xzdec from XZ Utils tends to be a safer choice when you don't control the creation of the input files.
If you end up using xzminidec you might want to check the compile-time defines which affect the features and size of the resulting xzminidec. They are in Makefile in BCJ_CPPFLAGS and CPPFLAGS variables. They are documented in README and xz.h.
Thanks for the explanation! This will do the job on Linux and Mac - I have full control over the creation of the input files. Is there any example of how one can use XZ Embedded to decompress files on Windows?
Maybe one needs to set stdin and stdout to binary mode in xzminidec to make it work on Windows. I don't know what else it could need.
/* Near the top of the file */
/* Before xz_crc32_init() in main() */
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.