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

Re: PATCH: new _print and thoughts on _arguments mutexes



Zefram wrote:

> I suppose you could play with (:>&p) type stuff.

That seems to work nicely, thanks.

> >      I can find out which file-descriptors are currently active using
> >/dev/fd/n tests but I haven't bothered because it wouldn't be much use
> >unless I could create meaningful descriptions of the file/pipe that the
> >file-descriptor points to.
> 
> Under Linux, readlink(2) on /proc/<foo>/fd/<n> is scarily useful.

That is useful. On the debian system here, there is a readlink(1). Is
that common on Linux?

When I look in /proc/$$/fd after creating a coprocess, I get something
like:
lrwx------    1 kiddleo  kiddleo        64 Apr 19 16:35 0 -> /dev/pts/0
lrwx------    1 kiddleo  kiddleo        64 Apr 19 16:35 1 -> /dev/pts/0
lrwx------    1 kiddleo  kiddleo        64 Apr 19 16:35 10 -> /dev/pts/0
lr-x------    1 kiddleo  kiddleo        64 Apr 19 16:35 11 ->
pipe:[111653]
l-wx------    1 kiddleo  kiddleo        64 Apr 19 16:35 14 ->
pipe:[111654]
lrwx------    1 kiddleo  kiddleo        64 Apr 19 16:35 2 -> /dev/pts/0
l-wx------    1 kiddleo  kiddleo        64 Apr 19 16:35 4 ->
pipe:[111654]

Does anyone know what the significance of the 111654 and 111653 is. Can
I convert them into anything useful like the PID of the coprocess. 

I'll look at doing an _file_descriptors this evening. Which directory
should it go in - Builtins? I suppose it'll only be useful for _print,
_read and _redirect?

Oliver



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