Closed ckolivas closed 4 years ago
This only affects decompressing or testing files. It does not affect compressing. See main.c
if (infile && !(DECOMPRESS || TEST_ONLY)) {
and NOT Decompressing or Testing. Works as designed.
Compressing works as normal and is not changed by this. Compress
$ lrzip/lrzip lrzip.tar
Output filename is: lrzip.tar.lrz
lrzip.tar - Compression Ratio: 4.543. Average Compression Speed: 5.333MB/s
Total time: 00:00:02.07
Test with Extension
$ lrzip/lrzip -t lrzip.tar.lrz
Decompressing...
100% 16.88 / 16.88 MB
Average DeCompression Speed: 16.000MB/s
[OK] - 17694720 bytes
Total time: 00:00:00.35
Test without Extension
$ lrzip/lrzip -t lrzip.tar
Decompressing...
100% 16.88 / 16.88 MB
Average DeCompression Speed: 16.000MB/s
[OK] - 17694720 bytes
Total time: 00:00:00.35
Decompress WITH Extension and Uncompressed file exists
$ lrzip/lrzip -d lrzip.tar.lrz
Output filename is: lrzip.tar
Failed to create lrzip.tar
File exists
Fatal error - exiting
Decompress without Extension AND Uncompressed file exists
$ lrzip/lrzip -d lrzip.tar
Output filename is: lrzip.tar
Failed to create lrzip.tar
File exists
Fatal error - exiting
$ rm lrzip.tar Decompress without Extension
$ lrzip/lrzip -d lrzip.tar
Output filename is: lrzip.tar
Decompressing...
100% 16.88 / 16.88 MB
Average DeCompression Speed: 16.000MB/s
Output filename is: lrzip.tar: [OK] - 17694720 bytes
Total time: 00:00:00.35
$ rm lrzip.tar Decompress WITH Extension
$ lrzip/lrzip -d lrzip.tar.lrz
Output filename is: lrzip.tar
Decompressing...
100% 16.88 / 16.88 MB
Average DeCompression Speed: 16.000MB/s
Output filename is: lrzip.tar: [OK] - 17694720 bytes
Total time: 00:00:00.35
This only affects decompressing or testing files. It does not affect compressing. See main.c
if (infile && !(DECOMPRESS || TEST_ONLY)) {
!DECOMPRESS would mean compress, no?
NOT (DECOMPRESS or TEST_ONLY)
So yes, if there IS an infile AND we are NOT ( Decompressing OR Testing )
The code Stanza in lrzip.c does not work as designed. I believe that this broke with the addition of STDIN and STDOUT functionality.
stat(control->infile, &fdin_stat);
if (!S_ISREG(fdin_stat.st_mode) && (tmp = strrchr(control->infile, '.')) &&
strcmp(tmp,control->suffix)) {
/* make sure infile has an extension. If not, add it
* because manipulations may be made to input filename, set local ptr
*/
No big deal though. No one has ever complained about this. Just wanted to restore designed functionality.
Reverts ckolivas/lrzip#157
Please correct ability to compress any filename.