Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Eric Pruitt
On Tue, May 12, 2015 at 10:35:52PM +0200, Eivind Uggedal wrote: > On Tue, May 12, 2015 at 10:10 PM, Dmitrij D. Czarkoff > wrote: > > On OpenBSD without "-f" tar opens /dev/rst0 or whatever TAPE is set to. > > This was the main reason I created the patch. I ported OpenBSD pax/tar > and I'm using it

Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Eivind Uggedal
On Tue, May 12, 2015 at 10:10 PM, Dmitrij D. Czarkoff wrote: > On OpenBSD without "-f" tar opens /dev/rst0 or whatever TAPE is set to. This was the main reason I created the patch. I ported OpenBSD pax/tar and I'm using it now for my distro. Since it defaults to the tape dev without -f- I have no

Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Dmitrij D. Czarkoff
Nick said: > Is - as a stdin/stdout file actually used many places? Because it > seems awfully weird to do: > > zcat < a.tar.gz | tar -t -f - > > rather than > > zcat < a.tar.gz | tar -t On OpenBSD without "-f" tar opens /dev/rst0 or whatever TAPE is set to. -- Dmitrij D. Czarkoff

Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Dimitris Papastamos
On Tue, May 12, 2015 at 06:57:12PM +0100, Nick wrote: > Is - as a stdin/stdout file actually used many places? Because it > seems awfully weird to do: > > zcat < a.tar.gz | tar -t -f - > > rather than > > zcat < a.tar.gz | tar -t > > or even use -f /dev/stdin as FRIGN suggested. > > If it isn

Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Nick
Is - as a stdin/stdout file actually used many places? Because it seems awfully weird to do: zcat < a.tar.gz | tar -t -f - rather than zcat < a.tar.gz | tar -t or even use -f /dev/stdin as FRIGN suggested. If it isn't used often, I'd prefer we don't support this weird syntax option. If it is

Re: [dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread FRIGN
On Tue, 12 May 2015 12:22:35 + Eivind Uggedal wrote: Hey Eivind, are you serious? > + if (file[0] == '-') This needs to be > + if (file[0] == '-' && file[1] == '\0') In any case, this could've also been done a bit more axiomatically. That's what the stdin/stdout fd's

[dev] [sbase] [PATCH] tar: support -f - as stdin/out

2015-05-12 Thread Eivind Uggedal
--- tar.1 | 4 +++- tar.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tar.1 b/tar.1 index 6341e17da4d0..ff6578b56d5c 100644 --- a/tar.1 +++ b/tar.1 @@ -32,7 +32,9 @@ before beginning. .It Fl f Ar file Set .Ar file -as input | output archive instead of stdin | stdout. +