Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: problem testing file descriptor 3



On Sunday 10 April 2005 23:58, Dominic Mitchell wrote:
> On Sun, Apr 10, 2005 at 11:33:32PM -0700, S. Cowles wrote:
> > I am having trouble testing if file descriptor 3 is already opened in the
> > calling environment.  If the file descriptor is not open, I would like to
...
>
> The -t flag tests to see whether an fd is open *and attached to a
> terminal*.  So it's probably no good for what you need.

Thank you.

> I think that the only way you could do this would be using the stat
> plugin.
>
>     % zmodload -i zsh/stat
>     % stat -f 3

Works beautifully.  Cheers.



Messages sorted by: Reverse Date, Date, Thread, Author