bug-coreutils
[Top][All Lists]
Advanced

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

Re: stat vs. "-"


From: Jim Meyering
Subject: Re: stat vs. "-"
Date: Tue, 29 Sep 2009 15:20:28 +0200

Eric Blake wrote:

> According to Jim Meyering on 9/29/2009 6:44 AM:
>> stat has two modes of operation: the default is to interpret each
>> argument as a file on which to call stat or lstat.
>> Then there's the --file-system (-f) option.
>>
>> The "-" == stdin approach makes sense for the first case.
>> Since I couldn't think of a use case for the second,
>> I was debating to implement it there regardless,
>> for the sake of consistency.  Otherwise, I'd have to
>> document that it works only *without* -f.
>
> But how would you make it work *with* -f?  You don't know the path of the
> file used to create stdin (and in the case of a pipe, there is no path),

There is no need for an actual file name, since fstatfs
takes a file descriptor.  Of course, there's the issue
that some systems don't have a usable fstatfs...

> so what would you pass to statvfs?  I don't see any option other than to
> go with documenting that -f and - do not work together; and we should make
> attempts to mix them fail with an error.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]