[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shar should print warning if file doesn't exist
From: |
Bruce Korb |
Subject: |
Re: shar should print warning if file doesn't exist |
Date: |
Sun, 24 Oct 2010 12:17:22 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100914 SUSE/3.0.8 Thunderbird/3.0.8 |
On 10/23/10 13:33, address@hidden wrote:
> $ ls
> $ shar blaa
> $ shar --version
> shar (GNU sharutils) 4.9
> $ shar bogus > foo
> shar: bogus: No such file or directory
Shar has been cleverly designed to throw away stderr
directly to /dev/null. So, it detects the problem but
you don't get to see it:
if (output == NULL)
output = stdout;
if (isatty (fileno (output)) && isatty (STDERR_FILENO))
freopen ("/dev/null", fwriteonly_mode, stderr);
This is so that error messages are not mixed in with the
desired output. A better choice could be made, like deferring
error messages then prefixing the error output with shell
comment markers. I'd accept such a patch.
Cheers - Bruce