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

Re: [BUG] process substitution breaks when nested or traverses a function



Op 24-04-18 om 12:47 schreef Peter Stephenson:
On Tue, 24 Apr 2018 10:30:16 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
I don't know about "better", but I'd looked into this and wondered why
getproc() had two compile-time alternative implementations, one with
mkfifo() and one with /proc/self.  Is this just about portability,
or...?

Using a file descriptor is neater, because there's less cruft in the
regular file system to clear up (and fewer associated security worries
etc. etc.); however, /proc/self isn't guaranteed to be available on
older systems, whereas FIFOs have been around for a good quarter
century.

/proc/self (or /proc in general) is not available on some very much current systems either, including at least macOS and OpenBSD.

/dev/fd is available on both of those, though.

- M.



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