[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

option `-o' for regular file

From: Adam Tuja
Subject: option `-o' for regular file
Date: Fri, 08 May 2020 04:47:00 +0200

Hello, I'm new here so I want to say hello to everyone first. I'm a fan of lzip 
and would like to make it better.

I was trying to add lzip support to Double/Total Commander through MultiArc 
plugin (or Far manager for that matter as it will work the same way) and come 
across some problems with it.
Reason for this is, for me, the fact that would make it lzip more useful and 
popular amongst more casual users. Not everyone is console freak and although I 
use it all the time but when come to browse and view files, archived including 
I don't fancy pager. Visual way is better and faster, especially when you want 
view something quickly and go to another task.
I tried to do it through another plugins but they are buggy and in annoying way 
with that. I also tried to use 7zip with lzip patch from savannah but it 
requires patching and recompiling every new release and it won't automatically 
work as you can guess, usually doesn't as these plugins don't want to cooperate 
with newer 7z.so/dll. So I thought configuring original compressor/s through 
MultiArc would be only beneficial as parallel version (plzip I mean) is so much 
better than any plugin or 7zip.

Back to subject, i tried to use `-o' option to decompresses to specified target 
as MultiArc needs target file specified in command line.
$ ls
$ lzip -k -d -o "dog9" "fox6.lz"
$ ls
fox6 fox6.lz

Then I realised that help says "if reading standard input, write to <file>". As 
lzip uses `-o' mode only when reading from stdin it's not very useful, 
therefore I wanted to propose to add such feature to the program. As it is now 
it works only in "single file mode" anyways so it wouldn't hurt if it was 
usable with regular file not only stdin. And a single file only.

# it works with 1 file:
$ echo "a1" > a1

$ cat a1 | lzip -k -f -o a1.lz
$ ls
a1 a1.lz

# but when combined with more file names it doesn't:
$ rm *.lz
$ echo "b2" > b2

$ cat a1 | lzip -k -f -o a1.lz b2
$ ls
a1 b2 b2.lz

$ rm *.lz
$ lzip -k -f -o a1.lz < a1  b2
$ ls
a1 b2 b2.lz


Another reason I talk about it is the fact that MultiArc requires ouput 
filename and there is no other way to specify it. Due to very basic pipe 
mechanism it uses (it is not a shell) option of redirecting it (from stdout: `$ 
lzip -dc "fox6.lz" > "dog9"') is not working, it treats `>' as another program 
argument (here: file name) rather than directive to redirect stream. I tried 
that too but it's not doable in current state of things.

As a matter of fact I "patched" clzip to make it work and it cooperates with 
MultiArc fine. (https://pastebin.pl/view/590e5462, 

As we are on the subject would be good to add option to list command that would 
display file name stripped of extension (`.lz'/`.lz*') which would add 
functionality to plugins like Multiarc or Far archiver to add lzip as another 
unpacker. Now, when it shows `archive.lz' in listing Multiarc user sees 
internal file name as `archive.tar.lz' not `archive.tar'. This way manager 
thinks that in `archive.tar.lz' there is another `archive.tar.lz'. It still can 
be unpacked (decompressed really) but name suggests it is `.tar.lz' archive 
when in fact it's `.tar'. It also makes it decompress file left panel 
`archive.tar.lz' to right panel `archive.tar.lz'. What a coincidence... Now 
only option is to rename it manually to `archive.tar'.
Something like this: (here called `x' as option to `-l')

$ lzip -lx fox6.lz
  uncompressed      compressed  saved  name
            270            480 -77.78%  fox6


reply via email to

[Prev in Thread] Current Thread [Next in Thread]