【问题标题】:How do I uncompress a file compressed with fusecompress/lzo?如何解压缩使用 fusecompress/lzo 压缩的文件?
【发布时间】:2009-06-13 03:06:54
【问题描述】:

我在 fusecompress/ 处安装了目录压缩 / 的 fusecompress 我将一个大文件(几 GB)复制到 fusecompress 目录(好的,我把它 mv 了)。 目录compressed/中的压缩文件长度为1,221,396,660。 但是,我无法删除/解压缩文件。 fusecompress 出现内存错误:“无法分配内存”。

有没有利用 lzo 库为压缩文件编写解压程序?

我尝试了以下方法,但出现分段错误:

    char buffer[OUT_LEN];
    char outbuffer[IN_LEN];
    int read;
    lzo_uint writ;
    unsigned long totalWrit = 0;

    while( (read = fread( buffer, sizeof(char), OUT_LEN, stdin )) > 0 )
    {
            r = lzo1x_decompress( buffer, read, outbuffer, &writ, NULL );
            fwrite( outbuffer, sizeof(char), writ, stdout );
            totalWrit += writ;
    }

    fprintf( stderr, "\nDone. %d bytes written out.\n\n", totalWrit );

更新:

响应bill,文件前160字节为:

00000000 01 1f 01 5d ff 89 04 00 a2 20 85 04 30 6e ba 48 |...]..... ..0n.H| 00000010 00 00 01 02 00 00 00 00 00 00 11 3c 3c 3c 20 53 |............>>..;.| 00000040 00 08 7f 10 da 是 01 00 01 00 90 01 00 54 00 3b |......T.;| 00000050 a8 00 20 c9 70 00 02 02 00 00 00 a2 2d b8 03 6c |.. .p.......-..l| 00000060 02 a9 02 80 a9 01 10 b4 01 00 15 28 00 00 52 08 |............(..R.| 00000070 00 00 a4 15 30 3e 76 22 73 4c 96 3d bf 8f ca 66 |....0>v"sL.=...f| 00000080 a8 93 2b a6 83 65 44 4d 37 41 a4 02 ca bb 56 4e |..+..eDM7A..VN| 00000090 a9 e9 b0 05 39 14 00 05 04 00 00 ff 00 00 00 3f |....9........?|

【问题讨论】:

    标签: c fuse lzo


    【解决方案1】:

    您必须查看文件是如何压缩的。 Witch Header 和附加数据存储在文件中。

    【讨论】:

    • 我发布了文件的标题。 160 字节够吗?
    • 抱歉,fusecompress 可以作为源代码使用。您可以查看code.google.com/p/fusecompress 并查看文件是如何压缩或解压缩的。
    • 我会试试的。谢谢。在这里询问是否有人以前遇到过。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-27
    相关资源
    最近更新 更多