Xref: utzoo unix-pc.bugs:32 comp.sys.att:4330 Path: utzoo!utgpu!water!watmath!clyde!att!icus!lenny From: lenny@icus.islp.ny.us (Lenny Tropiano) Newsgroups: unix-pc.bugs,comp.sys.att Subject: Named pipes on the UNIX PC, is there a problem with ls(1)? Keywords: pipes, mknod, FIFO's Message-ID: <507@icus.islp.ny.us> Date: 26 Sep 88 01:46:24 GMT Organization: ICUS Software Systems, Islip, New York Lines: 57 The "mknod(1M)" command can be used to create character and block devices, as well as, FIFO's or named pipes. mknod(1M) needs to be run as the super-user if you are creating anything but fifo's. Usage: mknod name c|b maj min -or- mknod name p Normally when you create a named pipe, the ls(1) command signifies this the same as it does with directories (d), character devices (c), and block devices (b) with "p". For some reason this doesn't work. For example the file /usr/spool/lp/FIFO is a named pipe, but the directory doesn't tell us. $ ls -l /usr/spool/lp/FIFO -rw------- 1 lp other 0 Sep 25 19:42 /usr/spool/lp/FIFO ^ Here should be a "p". Here's a short program to test for FIFO status: /* isfifo.c */ #include#include #include main(argc,argv) int argc; char *argv[]; { struct stat statbuf; if (argc < 2) { printf("usage: %s file\n", argv[0]); exit(1); } if (stat(argv[1],&statbuf) < 0) { perror("stat()"); exit(1); } printf("%s", argv[1]); if (statbuf.st_mode & S_IFIFO) printf(" is "); else printf(" isn't "); printf("a fifo\n"); } $ isfifo isfifo.c isfifo.c isn't a fifo $ isfifo /usr/spool/lp/FIFO /usr/spool/lp/FIFO is a fifo Why can't ls(1) do this too? I've seen it work elsewhere. -Lenny --- Lenny Tropiano ICUS Software Systems w: +1 (516) 582-5525 lenny@icus.islp.ny.us Telex: 154232428 ICUS h: +1 (516) 968-8576 {talcott,boulder,hombre,pacbell,sbcs}!icus!lenny attmail!icus!lenny ICUS Software Systems -- PO Box 1; Islip Terrace, NY 11752