Re: [xz-devel] lzma orig file and decompressed file are different.
From: Lasse Collin To: xz-devel@tukaani.org Sent: Sunday, December 18, 2011 5:23 PM Subject: Re: [xz-devel] lzma orig file and decompressed file are different. On 2011-12-16 stompdagg...@yahoo.com wrote: > in that case, what action should I take? Simply check that the last call to lzma_code has returned LZMA_STREAM_END. If it returned LZMA_OK, the decoder didn't decode the last bytes of the file and thus the file was truncated or otherwise corrupt. I see you copied the bug from xz_pipe_decomp.c. I'm sorry about that. I should have reviewed the example programs more carefully before accepting them. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode understood, thanks for the correction.
Re: [xz-devel] lzma orig file and decompressed file are different.
On 2011-12-16 stompdagg...@yahoo.com wrote: > in that case, what action should I take? Simply check that the last call to lzma_code has returned LZMA_STREAM_END. If it returned LZMA_OK, the decoder didn't decode the last bytes of the file and thus the file was truncated or otherwise corrupt. I see you copied the bug from xz_pipe_decomp.c. I'm sorry about that. I should have reviewed the example programs more carefully before accepting them. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
Re: [xz-devel] lzma orig file and decompressed file are different.
From: Lasse Collin To: xz-devel@tukaani.org Sent: Friday, December 16, 2011 9:53 PM Subject: Re: [xz-devel] lzma orig file and decompressed file are different. On 2011-12-16 stompdagg...@yahoo.com wrote: > yes! problem solved, the code can be viewed at > http://gitorious.org/open-source-soccer-manager/ossm/blobs/master/src/Utilities/Utils-General.cpp#line240 Good that it works. There's still a bug that it doesn't detect truncated files. You need to check that lzma_code has returned LZMA_STREAM_END to know that the end of the file was reached successfully. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode in that case, what action should I take?
Re: [xz-devel] lzma orig file and decompressed file are different.
On 2011-12-16 stompdagg...@yahoo.com wrote: > yes! problem solved, the code can be viewed at > http://gitorious.org/open-source-soccer-manager/ossm/blobs/master/src/Utilities/Utils-General.cpp#line240 Good that it works. There's still a bug that it doesn't detect truncated files. You need to check that lzma_code has returned LZMA_STREAM_END to know that the end of the file was reached successfully. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
Re: [xz-devel] lzma orig file and decompressed file are different.
From: Lasse Collin To: xz-devel@tukaani.org Sent: Thursday, December 15, 2011 8:43 PM Subject: Re: [xz-devel] lzma orig file and decompressed file are different. On 2011-12-13 stompdagg...@yahoo.com wrote: > back to topic, I've taken the pipe decompress example and started > modifying it, when I got to read from file, decompress and write file > using c functions it worked but when I changed it to c++ stream > handling see here: http://dpaste.com/673199/ the output file is > identical to the original but I get error code 10. > > how is that possible? I'm not sure. Using in.reasome looks suspicious. You may want to use in.read and in.gcount instead. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode yes! problem solved, the code can be viewed at http://gitorious.org/open-source-soccer-manager/ossm/blobs/master/src/Utilities/Utils-General.cpp#line240 thanks for the help :)
Re: [xz-devel] lzma orig file and decompressed file are different.
On 2011-12-13 stompdagg...@yahoo.com wrote: > back to topic, I've taken the pipe decompress example and started > modifying it, when I got to read from file, decompress and write file > using c functions it worked but when I changed it to c++ stream > handling see here: http://dpaste.com/673199/ the output file is > identical to the original but I get error code 10. > > how is that possible? I'm not sure. Using in.reasome looks suspicious. You may want to use in.read and in.gcount instead. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
Re: [xz-devel] lzma orig file and decompressed file are different.
From: Lasse Collin To: xz-devel@tukaani.org Sent: Tuesday, December 13, 2011 9:38 PM Subject: Re: [xz-devel] lzma orig file and decompressed file are different. On 2011-12-12 stompdagg...@yahoo.com wrote: > in regards to the registration, the main issue is that the return > mails are not clear, for example when I send confirmation, the answer > was not clear if it was successful so I've had to resend it, only > then I've scanned the return mail and found out that the original > answer confirmed my registration. Unfortunately I cannot change it without moving the list elsewhere and to another mailing list software. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode back to topic, I've taken the pipe decompress example and started modifying it, when I got to read from file, decompress and write file using c functions it worked but when I changed it to c++ stream handling see here: http://dpaste.com/673199/ the output file is identical to the original but I get error code 10. how is that possible?
Re: [xz-devel] lzma orig file and decompressed file are different.
On 2011-12-12 stompdagg...@yahoo.com wrote: > in regards to the registration, the main issue is that the return > mails are not clear, for example when I send confirmation, the answer > was not clear if it was successful so I've had to resend it, only > then I've scanned the return mail and found out that the original > answer confirmed my registration. Unfortunately I cannot change it without moving the list elsewhere and to another mailing list software. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
Re: [xz-devel] lzma orig file and decompressed file are different.
From: Lasse Collin To: xz-devel@tukaani.org Sent: Monday, December 12, 2011 6:55 PM Subject: Re: [xz-devel] lzma orig file and decompressed file are different. On 2011-12-09 stompdagg...@yahoo.com wrote: > I'm writing a c++ program that takes a sql text file compressed in > lzma (created by running lzma -9 ) and unlzma it. but for some > reason the result file is different, see here: > http://paste.pocoo.org/show/518724/ one of the line is cut and a 1 > char is has been added to some other ones. the relevant code can be > found here: http://paste.pocoo.org/show/518725/ Maybe the problem happens if the output buffer is filled partially and the input buffer becomes empty. After getting more input, the contents of the partially filled output buffer is lost. There is also a problem that the code doesn't check that the decoding ends with LZMA_STREAM_END. This means that you won't detect if the file is truncated. The code may read past the end of the output output buffer (dDataArr) when writing the data to the file on line 38. It could be better to omit the memset on line 27 and use mystream.write instead of operator<<. > OT: the list's registering procedure is very unclear, it would be > wise to make the return make more clearer as it took me few mails to > get registered and understand I'm registered, I'm registered to > another few lists so I can say it can be done. I'm sorry to hear that. I cannot affect how the actual subscribing is done over email. My hosting provider has Majordomo and that's what I have to use (or move the list elsewhere). I can improve the instructions on tukaani.org web site if you can explain what should be clarified. Thanks. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode Thanks for the tips I'll check them out. in regards to the registration, the main issue is that the return mails are not clear, for example when I send confirmation, the answer was not clear if it was successful so I've had to resend it, only then I've scanned the return mail and found out that the original answer confirmed my registration.
Re: [xz-devel] lzma orig file and decompressed file are different.
On 2011-12-09 stompdagg...@yahoo.com wrote: > I'm writing a c++ program that takes a sql text file compressed in > lzma (created by running lzma -9 ) and unlzma it. but for some > reason the result file is different, see here: > http://paste.pocoo.org/show/518724/ one of the line is cut and a 1 > char is has been added to some other ones. the relevant code can be > found here: http://paste.pocoo.org/show/518725/ Maybe the problem happens if the output buffer is filled partially and the input buffer becomes empty. After getting more input, the contents of the partially filled output buffer is lost. There is also a problem that the code doesn't check that the decoding ends with LZMA_STREAM_END. This means that you won't detect if the file is truncated. The code may read past the end of the output output buffer (dDataArr) when writing the data to the file on line 38. It could be better to omit the memset on line 27 and use mystream.write instead of operator<<. > OT: the list's registering procedure is very unclear, it would be > wise to make the return make more clearer as it took me few mails to > get registered and understand I'm registered, I'm registered to > another few lists so I can say it can be done. I'm sorry to hear that. I cannot affect how the actual subscribing is done over email. My hosting provider has Majordomo and that's what I have to use (or move the list elsewhere). I can improve the instructions on tukaani.org web site if you can explain what should be clarified. Thanks. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode