home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / wizards / 5619 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.9 KB  |  59 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!sdd.hp.com!ncr-sd!ncrcae!grok101.ColumbiaSC.NCR.COM!raj
  3. From: raj@grok101.ColumbiaSC.NCR.COM ()
  4. Subject: Re: named pipe
  5. Message-ID: <1993Jan22.152932.22443@ncrcae.ColumbiaSC.NCR.COM>
  6. Nntp-Posting-Host: grok101.columbiasc.ncr.com
  7. Organization: Your Organization Here
  8. References: <1993Jan22.185326.679@cine88.cineca.it>
  9. Date: Fri, 22 Jan 93 20:29:31 GMT
  10. Lines: 47
  11.  
  12. In article <1993Jan22.185326.679@cine88.cineca.it>, marcello@deis20.cineca.it (Marcello Dalpasso) writes:
  13. |> Is there any wizard on the net being so kind to summarize to me the usage of
  14. |> named pipes?!
  15.     The basic advantage is having a filesystem node to use and
  16. hence two unrelated processes can be communicating much like any
  17. other IPC. It is not like "unamed" pipes which can exist only between
  18. related processes (like parent-child).
  19.  
  20. |> 
  21. |> In particular, I would make something like this:
  22. |> 
  23. |> cp file named-pipe
  24. |> 
  25. |> and get "file" passed to lpr, i.e. named-pipe == | lpr
  26. |> 
  27.    Sure it can be done.
  28.  
  29. |> Thanks in advance for any help, preferably via e-mail
  30. |> 
  31. |> -- 
  32. |>     Marcello Dalpasso (e-mail: marcello@deis20.cineca.it)
  33. |>     D.E.I.S. - Department of Electronics, Computer Science and Systems
  34. |>     Viale Risorgimento 2, I-40136 Bologna, Italy            
  35. |>     Phone: +39-51-644-3015 (fax: +39-51-644-3073)
  36.  
  37. I am not sure what exactly you trying to achieve but anyway one
  38. way to use "named pipes" & lpr together is as follows:
  39.  
  40. 1) assume you have created a named pipe "/tmp/Fifo" using "mknod -p"
  41.  
  42. 2) Lets say your printer name is lp then we can do the following to
  43. read from the fifo:
  44.     cat /tmp/Fifo | /usr/ucb/lpr -P lp
  45.  
  46.     Now you will notice that it is waiting for data
  47. (remember it is a pipe)
  48.  
  49. 3) now you can copy the data to be printed into the named pipe as
  50. you wanted to do (i.e using cp) as shown below:
  51.  
  52.     cp /etc/passwd /tmp/Fifo
  53.  
  54.  
  55. hope this info helps.
  56.     Yes, you have used named pipes & lpr together.
  57. raj
  58. 1/22/93
  59.