Skip to main content

namedpipe

Function namedpipe 

Source
pub fn namedpipe() -> Option<String>
Expand description

Port of char *namedpipe(void) from Src/exec.c:5001.

C body (#ifdef HAVE_FIFOS branch):

char *tnam = gettempname(NULL, 1);
if (!tnam) {
    zerr("failed to create named pipe: %e", errno);
    return NULL;
}
if (mkfifo(tnam, 0600) < 0) {
    zerr("failed to create named pipe: %s, %e", tnam, errno);
    return NULL;
}
return tnam;

Create a FIFO with a unique name for process substitution. Used by getproc (<(cmd) / >(cmd)) on systems without /dev/fd.