我已经在 fusecompress/ 处安装了目录压缩 / 的 fusecompress 我将一个大文件(几 GB)复制到 fusecompress 目录(好的,我 mv'd 它)。目录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 );
更新:
作为对账单的回应,文件的前 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 |............<<< S| 00000020 75 6e 20 56 69 72 74 75 61 6c 42 6f 78 20 44 69 |un VirtualBox Di| 00000030 73 6b 20 49 6d 61 67 65 20 3e 3e 3e 0a 00 3b 00 |sk 图片 >>>..;.| 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........?|