NetBSD-Bugs archive

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

Re: stat(1) manpage displays non-existant (?) option



Thanks Dieter, yes, I took a look at the code where it's clear that -v is available only if stat is called as readlink. However, the manpage not only isn't as clear, but doesn't specify clearly _how_ to invoke stat as readlink. Matter of perception, perhaps.

On Sun, Jan 3, 2016 at 9:37 PM, dieter roelants <dieter.NetBSD%pandora.be@localhost> wrote:
On Sun, 3 Jan 2016 18:34:36 +0200
Rares Aioanei <schaiba%gmail.com@localhost> wrote:

> Environment is NetBSD 7.0/i386. The manpage displays -v as an option :
>
> "-v            Turn off quiet mode."
>
> However, that option is not recognized by stat(1) :
>
> $ stat -v
> stat: unknown option -- v
>
> However (again), the stat(1) code seems to indicate otherwise :
>
> while ((ch = getopt(argc, argv, options)) != -1)

If you look at the synopsis in the man page, you'll see that it's only
an option when stat is called as readlink. It makes it print a warning
for nonexisting files, which stat does by default unless called with
-q, which turns on quiet mode. (I guess the man page could be more
verbose about this, and also describe the option as turning on
verbosity.)

kind regards
dieter



--
Rares Aioanei


Home | Main Index | Thread Index | Old Index