reading from stdin and at the same time writing to stdout does not work

Bug #668727 reported by fabtagon
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
p7zip (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Binary package hint: p7zip

= expected behaviour =

7z(a) should be able to be used in pipe filters and thus to read from stdin (-si) and write to stdout (-so). This works as long as only one of these is used (e.g. 7z at begin or end of pipe). If you want both to work together (e.g. in the middle of the pipe) 7z denies execution.

man 7z (same for 7za) documents the option as follows:

  -so Write data to StdOut (eg: % echo foo | 7z a dummy -tgzip -si -so > /dev/null)

= experienced behaviour =

However if you do this (same again for 7za):

  $ echo foo | 7z -a dummy -tgzip -si -so > testfile

Return value is 7 (bad command line) and testfile has the following content (not compressed or something):

  Error:
  Incorrect command line

(It's furthermore noteworthy that an error message is written to stdout while I want to have my actual data there - what's going to happen if 7z encounters a bug while compressing - do I get my data stream corrupted by a message then? But that's another issue)

= external bug tracking =

Bug exists since 7 years in the project's bug tracker: http://sourceforge.net/tracker/?func=detail&aid=1627883&group_id=111810&atid=660493 . Debian has no references to this bug.

= resolution =

Maybe the feature could be marked as missing in the bug section of the man page. The misleading example should vanish.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: p7zip-full 9.04~dfsg.1-1
ProcVersionSignature: Ubuntu 2.6.32-25.45-generic 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Sat Oct 30 15:14:40 2010
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release amd64 (20091027)
ProcEnviron:
 PATH=(custom, user)
 LANG=sv_SE.utf8
 SHELL=/bin/bash
SourcePackage: p7zip

Revision history for this message
fabtagon (fabtagon) wrote :
Revision history for this message
fabtagon (fabtagon) wrote :

(the bug exists in the project's bug tracker since 3 years, since the year 2007, sorry for confusing the numbers, but does not change the situation)

Revision history for this message
fabtagon (fabtagon) wrote :

Further investigation reveals that my 'real use' of 7z with -si and -so simultaneously breaks because 7z does support this behaviour for some compression methods (e.g. gzip) and doesn't for others (e.g. default methods which I want to use).

My sample up there has a typo:

$ echo foo | 7z -a dummy -tgzip -si -so > testfile
                ^
The '-' should not be there and thus breaks the correct sample command line from documentation. When used properly this works.

What still does not work is:

$ echo foo | 7z a dummy -si -so > testfile

So the resolution should be changed to indicate that the simultaneous use of -si and -so is dependent on a restricted selection of compression methods.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in p7zip (Ubuntu):
status: New → Confirmed
Rolf Leggewie (r0lf)
Changed in p7zip (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.