Feature request: Pipeline (stdin, stdout, stderr)
It's not implemented.
7z a BackupDir -so | zenity --progress
System ERROR:
E_NOTIMPL
7-zip does not allow streamed write of 7z format, it requires free seeking access as it writes, amongst the other stuff, header at the end of operation. It does allow to pipe standard *nix formats like bz2, gz, xz, though. It also allows to pipe single input without restrictions (-si switch).
Yes. This is the request.
It will not work. 7-zip must seek back to the beginning of the file to modify header where it saves position of footer (for some unknown reason called by dev end header). It is not possible in streamed output. Even zip cannot do that.
Only archive format that is able to be send to standard output is tar:
$ 7z a -ttar -so -an <list of files> > archive.tar
Also "standard" *nix compressors, namely bzip2, gzip, xz:
$ cat archive.tar | 7z a -tgzip -si -so -an > archive.tar.gz
Add dir to dir.tar.7z:
7z a dir -ttar -so -an | 7z a dir.tar.7z -si
Extract dir.tar.7z to dir:
7z x dir.tar.7z -so | tar -xvf -
But in dir.tar.7z at the top level is dir.tar, not files of the dir.
This works, but unevenly, because top level is dir.tar.
7z x dir.tar.7z -so | tar -xvf - | pv -n 2>&1 | zenity --progress
Probably without tar it will not work.
Just to be clear - tar archive doesn't need backward seeking therefore can be written to stdout. Zip, 7z, rar formats need it so they can only be written into regular files.
Yes you can compress single file into .7z, whether it's tar or anything else, therefore you can put it into stdin of 7-zip but you cannot write .7z (or .zip or .rar) into stdout because you cannot seek backward in stdout stream.
Check How to recover corrupted 7z archive to see what it means. There is a description of format that explains why it is so.
OK. Thanks.