home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / wizards / 5300 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.5 KB  |  34 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!mcdchg!chinet!les
  3. From: les@chinet.chi.il.us (Leslie Mikesell)
  4. Subject: Re: /dev
  5. Message-ID: <BzMAFp.6rA@chinet.chi.il.us>
  6. Organization: Chinet - Public Access UNIX
  7. References: <1h3m36INNd4l@usenet.INS.CWRU.Edu>
  8. Date: Mon, 21 Dec 1992 16:14:13 GMT
  9. Lines: 23
  10.  
  11. In article <1h3m36INNd4l@usenet.INS.CWRU.Edu> cq377@cleveland.Freenet.Edu (David C. Williss) writes:
  12.  
  13. >I have a question, and maybe somebody here can point me in the right 
  14. >direction.  I'm working on a software package wich we are porting to
  15. >Unix and one of my parts is the hardcopy output.  On the old system
  16. >I could just open "lpt1:" and start dumping.  On unix, things become
  17. >harder.  
  18.  
  19. Not hard at all. Let the user or administrator enter an arbitrary string
  20. for the process to accept the printout.  Use popen() to start it up.
  21. Don't try to second guess the contents of the string - it's likely
  22. to be things like "uux - othermachine!lp -d someprinter" or
  23. "mp | uux - othermachine!lp -d postscriptprinter"  or whatever
  24. pipeline it takes to get the job where they want it.
  25. Since there are likely to be many printers available on a unix machine
  26. it's nice to give the user a choice at run time as well as having
  27. a configured default for each user.  Sometimes it's convenient to
  28. bundle this with the option to save the print image to a file - if
  29. the user types something starting with "|", feed it to popen() instead
  30. of fopen().
  31.  
  32. Les Mikesell
  33.   les@chinet.chi.il.us
  34.