Results 1 to 19 of 19

Thread: how to unzip lz file?

  1. #1
    Member
    Join Date
    May 2008
    Location
    CN
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

  2. #2
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,497
    Thanks
    733
    Thanked 659 Times in 354 Posts
    lzma/lzma2/7z may do the trick

  3. #3
    Tester
    Black_Fox's Avatar
    Join Date
    May 2008
    Location
    [CZE] Czechia
    Posts
    471
    Thanks
    26
    Thanked 9 Times in 8 Posts
    Nope. Magic bytes are LZIP by the way.
    I am... Black_Fox... my discontinued benchmark
    "No one involved in computers would ever say that a certain amount of memory is enough for all time? I keep bumping into that silly quotation attributed to me that says 640K of memory is enough. There's never a citation; the quotation just floats like a rumor, repeated again and again." -- Bill Gates

  4. #4
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    Maybe this will help but you need to compile it.
    http://www.nongnu.org/lzip/lzip.html
    http://ftp.twaren.net/Unix/NonGNU/lzip/

  5. #5
    Member
    Join Date
    May 2008
    Location
    CN
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Skymmer View Post
    Maybe this will help but you need to compile it.
    http://www.nongnu.org/lzip/lzip.html
    http://ftp.twaren.net/Unix/NonGNU/lzip/
    can you give me an executable file

  6. #6
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    I realy would like to but unfortunately I'm still out of that magic skill

  7. #7
    Tester
    Black_Fox's Avatar
    Join Date
    May 2008
    Location
    [CZE] Czechia
    Posts
    471
    Thanks
    26
    Thanked 9 Times in 8 Posts
    Here I hacked something together so it would compile, basically I just commented out POSIX-only flags and signals. I don't know if it can work at all in this shape, so use it only on your own responsibility, not my problem if it doesn't work, eats your computer etc.
    Attached Files Attached Files
    I am... Black_Fox... my discontinued benchmark
    "No one involved in computers would ever say that a certain amount of memory is enough for all time? I keep bumping into that silly quotation attributed to me that says 640K of memory is enough. There's never a citation; the quotation just floats like a rumor, repeated again and again." -- Bill Gates

  8. #8
    Member
    Join Date
    May 2008
    Location
    CN
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Black_Fox View Post
    Here I hacked something together so it would compile, basically I just commented out POSIX-only flags and signals. I don't know if it can work at all in this shape, so use it only on your own responsibility, not my problem if it doesn't work, eats your computer etc.
    D:\lt\dl\lzip>lzip -h
    Lzip - A data compressor based on the LZMA algorithm.

    Usage: lzip [options] [files]

    Options:
    -h, --help display this help and exit
    -V, --version output version information and exit
    -b, --member-size=<n> set member size limit in bytes
    -c, --stdout send output to standard output
    -d, --decompress decompress
    -f, --force overwrite existing output files
    -k, --keep keep (don't delete) input files
    -m, --match-length=<n> set match length limit in bytes [80]
    -o, --output=<file> if reading stdin, place the output into <file>
    -q, --quiet suppress all messages
    -s, --dictionary-size=<n> set dictionary size limit in bytes [8MiB]
    -S, --volume-size=<n> set volume size limit in bytes
    -t, --test test compressed file integrity
    -v, --verbose be verbose (a 2nd -v gives more)
    -1 .. -9 set compression level [default 6]
    --fast alias for -1
    --best alias for -9
    If no file names are given, lzip compresses or decompresses
    from standard input to standard output.
    Numbers may be followed by a multiplier: k = kB = 10^3 = 1000,
    Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...

    Report bugs to lzip-bug@nongnu.org
    Lzip home page: http://www.nongnu.org/lzip/lzip.html

    D:\lt\dl\lzip>lzip -d gmp-4.3.1.tar.lz
    gmp-4.3.1.tar.lz: file ends unexpectedly at pos 150
    lzip: Deleting output file 'gmp-4.3.1.tar', if it exists.
    lzip: WARNING: deletion of output file (apparently) failed.

  9. #9
    Expert
    Matt Mahoney's Avatar
    Join Date
    May 2008
    Location
    Melbourne, Florida, USA
    Posts
    3,255
    Thanks
    306
    Thanked 778 Times in 485 Posts
    I had a similar problem. I wonder if fopen(...,"r") and "w" need to be changed to "rb" and "wb" for Windows. I didn't look at the source code.

    Code:
    C:\res>timer \tmp\lzip -k -9 enwik8
    
    Timer 3.01  Copyright (c) 2002-2003 Igor Pavlov  2003-07-10
    lzip: I can't change output file attributes.
    
    Kernel Time  =     1.123 = 00:00:01.123 =   0%
    User Time    =   398.442 = 00:06:38.442 =  98%
    Process Time =   399.565 = 00:06:39.565 =  98%
    Global Time  =   405.010 = 00:06:45.010 = 100%
    
    C:\res>dir enwik8*
     Volume in drive C is OS
     Volume Serial Number is 66E6-426E
    
     Directory of C:\res
    
    07/23/2009  08:36 PM       100,000,000 enwik8
    08/18/2009  09:28 PM        25,311,100 enwik8.lz
                   2 File(s)    125,311,100 bytes
                   0 Dir(s)  24,573,317,120 bytes free
    
    C:\res>rename enwik8 enwik8.tmp
    
    C:\res>timer \tmp\lzip -d enwik8.lz
    
    Timer 3.01  Copyright (c) 2002-2003 Igor Pavlov  2003-07-10
      enwik8.lz: file ends unexpectedly at pos 512
    lzip: Deleting output file 'enwik8', if it exists.
    lzip: WARNING: deletion of output file (apparently) failed.
    
    Kernel Time  =     0.015 = 00:00:00.015 =  50%
    User Time    =     0.000 = 00:00:00.000 =   0%
    Process Time =     0.015 = 00:00:00.015 =  50%
    Global Time  =     0.031 = 00:00:00.031 = 100%
    Edit: I noticed that the truncated output of enwik8 (1668 bytes) has LF replaced with CR LF.
    Last edited by Matt Mahoney; 19th August 2009 at 04:44.

  10. #10
    Member
    Join Date
    May 2008
    Location
    CN
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Matt Mahoney View Post
    I had a similar problem. I wonder if fopen(...,"r") and "w" need to be changed to "rb" and "wb" for Windows. I didn't look at the source code.

    Code:
    C:\res>timer \tmp\lzip -k -9 enwik8
    
    Timer 3.01  Copyright (c) 2002-2003 Igor Pavlov  2003-07-10
    lzip: I can't change output file attributes.
    
    Kernel Time  =     1.123 = 00:00:01.123 =   0%
    User Time    =   398.442 = 00:06:38.442 =  98%
    Process Time =   399.565 = 00:06:39.565 =  98%
    Global Time  =   405.010 = 00:06:45.010 = 100%
    
    C:\res>dir enwik8*
     Volume in drive C is OS
     Volume Serial Number is 66E6-426E
    
     Directory of C:\res
    
    07/23/2009  08:36 PM       100,000,000 enwik8
    08/18/2009  09:28 PM        25,311,100 enwik8.lz
                   2 File(s)    125,311,100 bytes
                   0 Dir(s)  24,573,317,120 bytes free
    
    C:\res>rename enwik8 enwik8.tmp
    
    C:\res>timer \tmp\lzip -d enwik8.lz
    
    Timer 3.01  Copyright (c) 2002-2003 Igor Pavlov  2003-07-10
      enwik8.lz: file ends unexpectedly at pos 512
    lzip: Deleting output file 'enwik8', if it exists.
    lzip: WARNING: deletion of output file (apparently) failed.
    
    Kernel Time  =     0.015 = 00:00:00.015 =  50%
    User Time    =     0.000 = 00:00:00.000 =   0%
    Process Time =     0.015 = 00:00:00.015 =  50%
    Global Time  =     0.031 = 00:00:00.031 = 100%
    Edit: I noticed that the truncated output of enwik8 (1668 bytes) has LF replaced with CR LF.
    the program can only run on ix os?

  11. #11
    Member
    Join Date
    Jun 2008
    Location
    USA
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Cygwin compiles it okay, and it seems to work (unpacked testsuite/COPYING.lz) although for some reason the permissions are wacko once decompressed, so you have to go back to Cygwin just to access it ("chmod +r"). Or maybe that's just my machine or I did something wrong (ugh). I actually tried with DJGPP, but it fails on decompression, so I dunno.

    1. Download Link: Click here to download file
    http://rapidshare.com/files/26897455...18rc2.zip.html
    MD5: DC4338DB7F4DAF330966F34C08574805

    (N.B. This is binaries and sources but not the Cygwin .DLL, which would require me to also give you the 12 MB of sources. I assume you can find it elsewhere, though.)

  12. #12
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,497
    Thanks
    733
    Thanked 659 Times in 354 Posts
    Quote Originally Posted by Matt Mahoney View Post
    I had a similar problem. I wonder if fopen(...,"r") and "w" need to be changed to "rb" and "wb" for Windows.
    yes, definitely. "r"/"w" opens files in text mode

  13. #13
    Tester
    Black_Fox's Avatar
    Join Date
    May 2008
    Location
    [CZE] Czechia
    Posts
    471
    Thanks
    26
    Thanked 9 Times in 8 Posts
    it uses open, not fopen, so not that easy to fix
    Last edited by Black_Fox; 19th August 2009 at 13:14.
    I am... Black_Fox... my discontinued benchmark
    "No one involved in computers would ever say that a certain amount of memory is enough for all time? I keep bumping into that silly quotation attributed to me that says 640K of memory is enough. There's never a citation; the quotation just floats like a rumor, repeated again and again." -- Bill Gates

  14. #14
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,497
    Thanks
    733
    Thanked 659 Times in 354 Posts
    Quote Originally Posted by Black_Fox View Post
    it uses open, not fopen, so not that easy to fix
    add O_BINARY like here:

    handle = ::_wopen (filename, mode==READ_MODE? O_RDONLY|O_BINARY : O_WRONLY|O_BINARY|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE);

  15. #15
    Member
    Join Date
    May 2008
    Location
    CN
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Rugxulo View Post
    Cygwin compiles it okay, and it seems to work (unpacked testsuite/COPYING.lz) although for some reason the permissions are wacko once decompressed, so you have to go back to Cygwin just to access it ("chmod +r"). Or maybe that's just my machine or I did something wrong (ugh). I actually tried with DJGPP, but it fails on decompression, so I dunno.

    1. Download Link: Click here to download file
    http://rapidshare.com/files/26897455...18rc2.zip.html
    MD5: DC4338DB7F4DAF330966F34C08574805

    (N.B. This is binaries and sources but not the Cygwin .DLL, which would require me to also give you the 12 MB of sources. I assume you can find it elsewhere, though.)
    I got cygwin1-20090818.dll.bz2 and rename it to cygwin1.dll,then everything is ok.Thank you!

  16. #16
    Expert
    Matt Mahoney's Avatar
    Join Date
    May 2008
    Location
    Melbourne, Florida, USA
    Posts
    3,255
    Thanks
    306
    Thanked 778 Times in 485 Posts
    Files in programs compiled in cygwin g++ are opened in binary mode by default, so lzip should work there. Also, in Windows lzip created files with the read-only attribute set. I could not delete them until I did ATTRIB -R first.

  17. #17
    Tester
    Black_Fox's Avatar
    Join Date
    May 2008
    Location
    [CZE] Czechia
    Posts
    471
    Thanks
    26
    Thanked 9 Times in 8 Posts
    Good one Bulat! I tried decompressing the gmp-4.3.1 file from here - successfully.

    EDIT: cmdline used: g++ -O2 arg_parser.cc decoder.cc encoder.cc main.cc -o lzip.exe
    Attached Files Attached Files
    Last edited by Black_Fox; 19th August 2009 at 22:33.
    I am... Black_Fox... my discontinued benchmark
    "No one involved in computers would ever say that a certain amount of memory is enough for all time? I keep bumping into that silly quotation attributed to me that says 640K of memory is enough. There's never a citation; the quotation just floats like a rumor, repeated again and again." -- Bill Gates

  18. #18
    Member
    Join Date
    May 2008
    Location
    HK
    Posts
    160
    Thanks
    4
    Thanked 25 Times in 15 Posts
    I did my own compilation with gcc-4.1.3 (from RosBE) and stripped.
    bundled with generated Makefile and patch.
    Attached Files Attached Files

  19. #19
    Member Skymmer's Avatar
    Join Date
    Mar 2009
    Location
    Russia
    Posts
    681
    Thanks
    37
    Thanked 168 Times in 84 Posts
    A brief speed test for provided compilations on enwik8
    LZIP command line used: --keep --match-length=273 --dictionary-size=67108864
    7-zip command line used: -m0=LZMA:a=1:d=64m:fb=273

    Code:
    Black_Fox = 179.457 = 24 856 053
      roytam1 = 186.805 = 24 856 053
      Rugxulo = 177.671 = 24 856 053
    
    7za v9.06 = 157.972 = 24 828 659

Similar Threads

  1. Unzip 6.0 (Info-Zip)
    By Rugxulo in forum Data Compression
    Replies: 1
    Last Post: 19th May 2009, 03:09
  2. Can't extract file from ARC file.
    By Absurd in forum Data Compression
    Replies: 3
    Last Post: 26th January 2009, 21:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •