2

z files from an old QNX system which needs to be unpacked in preferable Centos.

These files are packed with the QNX pack method and there is no Virtual Machine (VMWARE) available to load QNX and unpack these files.

I've tried all the available extraction programs, but no one is able to unpack these. File filename gives data as result I've tried the following:

  • gunzip
  • uncompress
  • tar
  • winrar
  • 7z
  • unzip

Output in Centos:

-rwxr--r-- 1 root root  896 Mar 11 05:15 PMITN01.z
[root@green update]# zcat PMITN01.z
zcat: PMITN01.z: not in gzip format
[root@green update]# gunzip PMITN01.z
gunzip: PMITN01.z: not in gzip format
[root@green update]# uncompress -v PMITN01.z
PMITN01.z - no .Z suffix
[root@green update]# tar -zxvf PMITN01.z
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors
[root@green update]# cat PMITN01.z | cpio -imdv
cpio: premature end of archive
[root@green update]# file PMITN01.z
PMITN01.z: data

After installing freeze/melt:

[root@green update]# cp PMITN01.z PMITN01.z.F
[root@green update]# melt PMITN01
PMITN01.F: No such file or directory
[root@green update]# melt PMITN01.z
PMITN01.z.F: not in frozen format

The only valuable search I've found is the following OpenQNX forum.

-----UPDATE--------

I've added the file here so you can see/check what kind of file it is.

I still haven't found an answer for my question, so I don't know why answers get upvoted....

To make it more complicated the system used probably split the files into multiple files, here is a ll -hal output:

-rwxrw-r-- 1 root root  357 Feb  7  2012 PMIPN.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN01.z
-rwxrw-r-- 1 root root  695 Feb  7  2012 PMIRN02.z
-rwxrw-r-- 1 root root  995 Feb  7  2012 PMIRN03.z
-rwxrw-r-- 1 root root  363 Feb  7  2012 PMIRN04.z
-rwxrw-r-- 1 root root 3.2K Feb  7  2012 PMIRN05.z
-rwxrw-r-- 1 root root  363 Feb  7  2012 PMIRN06.z
-rwxrw-r-- 1 root root  363 Feb  7  2012 PMIRN07.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN08.z
-rwxrw-r-- 1 root root  851 Feb  7  2012 PMIRN09.z
-rwxrw-r-- 1 root root 1022 Feb  7  2012 PMIRN10.z
-rwxrw-r-- 1 root root  361 Feb  7  2012 PMIRN11.z
-rwxrw-r-- 1 root root  695 Feb  7  2012 PMIRN12.z
-rwxrw-r-- 1 root root  15K Feb  7  2012 PMIRN13.z
-rwxrw-r-- 1 root root  16K Feb  7  2012 PMIRN14.z
-rwxrw-r-- 1 root root 1.6K Feb  7  2012 PMIRN15.z
-rwxrw-r-- 1 root root  638 Feb  7  2012 PMIRN16.z
-rwxrw-r-- 1 root root 1.9K Feb  7  2012 PMIRN17.z
-rwxrw-r-- 1 root root  13K Feb  7  2012 PMIRN18.z
-rwxrw-r-- 1 root root  363 Feb  7  2012 PMIRN19.z
-rwxrw-r-- 1 root root  578 Feb  7  2012 PMIRN20.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN21.z
-rwxrw-r-- 1 root root 1.6K Feb  7  2012 PMIRN22.z
-rwxrw-r-- 1 root root  361 Feb  7  2012 PMIRN23.z
-rwxrw-r-- 1 root root  361 Feb  7  2012 PMIRN24.z
-rwxrw-r-- 1 root root  688 Feb  7  2012 PMIRN25.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN26.z
-rwxrw-r-- 1 root root  650 Feb  7  2012 PMIRN27.z
-rwxrw-r-- 1 root root  801 Feb  7  2012 PMIRN28.z
-rwxrw-r-- 1 root root 3.0K Feb  7  2012 PMIRN29.z
-rwxrw-r-- 1 root root  361 Feb  7  2012 PMIRN30.z
-rwxrw-r-- 1 root root  354 Feb  7  2012 PMIRN31.z
-rwxrw-r-- 1 root root  569 Feb  7  2012 PMIRN32.z
-rwxrw-r-- 1 root root  361 Feb  7  2012 PMIRN33.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN34.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN35.z
-rwxrw-r-- 1 root root 7.8K Feb  7  2012 PMIRN36.z
-rwxrw-r-- 1 root root  875 Feb  7  2012 PMIRN37.z
-rwxrw-r-- 1 root root 4.6K Feb  7  2012 PMIRN38.z
-rwxrw-r-- 1 root root 3.2K Feb  7  2012 PMIRN39.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN40.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN41.z
-rwxrw-r-- 1 root root 7.4K Feb  7  2012 PMIRN42.z
-rwxrw-r-- 1 root root  362 Feb  7  2012 PMIRN43.z

As you can see it's not a clear split on filesize.

  • 1
    Please list the ones you've tried so we don't suggest them as options. – terdon Mar 10 '14 at 17:06
  • I've added the list of the tools I've tried – Tahir Malik Mar 11 '14 at 9:11
  • Your here link is to some website that doesn't render properly in half the browsers I tried and requires some login in the other half. – Stéphane Chazelas Mar 17 '14 at 16:13
3

The linked example is a zlib stream. You can use pigz (a parallel implementation of gzip) to decompress the .z files. E.g.

pigz -dz *.z

If you want to combine the resulting PMRINnn, you can use cat, where the wildcard will order them by name:

cat PMRIN?? > PMRIN
  • File output differs a bit from the output of illuminÉ so I'm testing it a bit – Tahir Malik Mar 14 '14 at 10:06
  • The output of what? The example file you gave is a complete and correct zlib stream. – Mark Adler Mar 14 '14 at 16:09
5

You should first try the command

file yourfilename.z

and see what it is identified as, that should be an indication which program.

If file says this is compress'd data 16 bits you can use

gzip -d < yourfilename.z > yourfilename

to uncompress it (in addition to the uncompress program.

  • I believe these .Z files in QNX were generated w/ the freeze and melt commands. You should be able to gunzip them. SRC: linux.ittoolbox.com/groups/technical-functional/redhat-l/… – slm Mar 10 '14 at 17:30
  • I've tried that and it doesn't work – Tahir Malik Mar 11 '14 at 9:12
  • You don't have the file command? – Anthon Mar 11 '14 at 9:13
  • I've got file command, you can see the output in the question – Tahir Malik Mar 11 '14 at 9:19
  • @TahirMalik Try to install melt on your system and try that, as slm suggested. – Anthon Mar 11 '14 at 9:22
3
+50

Run the following perl script in the directory containing your file (for instance the one you linked in your Q, media.ini.z):

#!/usr/bin/perl -w
use strict;
use Compress::Zlib;

my ($tempFilename2, $tempFilename1, $gz, $buffer, $gzerrno);
$tempFilename1 = "mediainf.ini.z";
$tempFilename2 = "mediainf.ini";
open (GZIPFILE, "$tempFilename1") 
   || warn "Can't open zip input file: $tempFilename1: $!";
binmode GZIPFILE;
open (DATAFILE, ">>$tempFilename2")  
   || warn "Can't open uncompressed data file: $tempFilename2: $!";
binmode DATAFILE;
my $x = inflateInit()
   or die "Cannot create a inflation stream\n" ;

my $input = '' ;

my ($output, $status) ;
while (read(GZIPFILE, $input, 4096))
{
    ($output, $status) = $x->inflate(\$input) ;

    print DATAFILE $output 
        if $status == Z_OK or $status == Z_STREAM_END ;

    last if $status != Z_OK ;
}

die "inflation failed\n"
    unless $status == Z_STREAM_END ;

Output of mediainf.ini:

00:01=outinf_md5&lang_cd;
00:02=db_area_name&db_fname&part&dir&decomp_sz&file_op&ftype&data_type_id&area_id;
01:c3031a6ffb4e0d09f88043b6692b956c&en;
01:c3031a6ffb4e0d09f88043b6692b956c&fr;
01:c3031a6ffb4e0d09f88043b6692b956c&de;
01:c3031a6ffb4e0d09f88043b6692b956c&es;
01:c3031a6ffb4e0d09f88043b6692b956c&it;
01:c3031a6ffb4e0d09f88043b6692b956c&pt;
01:c3031a6ffb4e0d09f88043b6692b956c&nl;
01:c3031a6ffb4e0d09f88043b6692b956c&ru;
01:c3031a6ffb4e0d09f88043b6692b956c&none;

See also this other Q&A for alternatives to uncompress raw zlib data.

  • 1
    +1 for figuring out that it was a raw zlib stream. Your perl script is kind of long, though, compared to the methods in this other question like openssl zlib -d – Wumpus Q. Wumbley Mar 14 '14 at 4:52
  • 1
    Thanks! I'm testing a bit here and there and will let you know if it is any good. – Tahir Malik Mar 14 '14 at 10:05
  • @WumpusQ.Wumbley In the link I included, there is a shorter one using io-zlib but I haven't sampled it. Of course I didn't write any of this. It was all trial and error, rpmunpacking melt6 and libmlt to make sure it had nothing to do with that (melt before freeze is a cable tv video multiplexer stream program??), etc. Just is a fluke I found this. I make up for the lack of expertise with extreme resilience. – user44370 Mar 14 '14 at 12:43
1

What does file(1) tell you?

The Wikipedia page seems to imply an obsolete format (plain Huffman coding) handled by the pack command on Unix. My (not really exhaustive search) doesn't give any pointers to the format, or source code. Perhaps The Unix Heritage Society has some ancient code laying around.

But getting prehistoric C to compile can be an interesting exercise. Unless you are doing all this purely for the entertainment value, getting any recent(ish) machine and running QNX on a virtual machine will hurt a lot less.

  • I can't find anywhere a VM with QNX on it, I've tried to run HP trux64 on a PersonalAlpha Emulator but the command unpack/pack wasn't available – Tahir Malik Mar 11 '14 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.