home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / wizards / 5295 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!chnews!sedona!bhoughto
  2. From: bhoughto@sedona.intel.com (Blair P. Houghton)
  3. Newsgroups: comp.unix.wizards
  4. Subject: Re: /dev
  5. Date: 21 Dec 1992 19:53:38 GMT
  6. Organization: Intel Corp., Chandler, Arizona
  7. Lines: 56
  8. Message-ID: <1h57c2INNhsi@chnews.intel.com>
  9. References: <1h3m36INNd4l@usenet.INS.CWRU.Edu>
  10. NNTP-Posting-Host: stealth.intel.com
  11.  
  12. In article <1h3m36INNd4l@usenet.INS.CWRU.Edu> cq377@cleveland.Freenet.Edu (David C. Williss) writes:
  13. >  1.  Should I look at the /etc/printcap file to find printers?
  14.  
  15. Look at the PRINTER environment variable (RTFM getenv(3)),
  16. and then check the printcap(5) and use the first printer
  17. you find there.  That is, *if* the machine has a printcap
  18. (AIX does not; it uses a thing called "qconfig.")
  19.  
  20. Or just use lpr(1).
  21.  
  22. >      Assuming that somebody at the user's site is compatent
  23. >      (bad assumption) they would just have to setup printcap
  24. >      The problems here are 1. Based on past experience, I can't
  25. >      assume they know what their doing.
  26.  
  27. Tough cookies on them, then.  Have the program barf a
  28. warning about a screwed-up printcap.  Users aren't nearly
  29. as fragile as programmers believe.  And if they have any
  30. normal printers to which your output could go, they'll have
  31. to have a working printcap, so it's a bad assumption if and
  32. only if it's a bad assumption that they have a printer.
  33.  
  34. Or just use lpr.
  35.  
  36. >2. Seems not all flavors
  37. >      of unix use /etc/printcap. (We're supporting multiple platforms)
  38. >
  39. >  2.  How do I print to a remote printer.  I suppose I could fork
  40. >      and exec lpr.  Is that the reccomended method?  
  41.  
  42. Barry says to use popen(3) and lpr.  I say, "What he said."
  43.  
  44. >  3.  For the sake of argument, lets say I ignore printcap and let the
  45. >      user select printer driver/port from within my program.  Is
  46. >      there any way to tell which special files in /dev are ports
  47. >      and which aren't?  Every book I've read talks about "conventional"
  48. >      names, but every implementation seems to have its own ideas
  49. >      as what to name them.  I want to avoid confusing the user by
  50. >      showing such things as /dev/rroot.
  51.  
  52. Okay, sounds like what you're really saying is they'll have
  53. printers available that never need to use lpr.  Some
  54. plotter drivers I know of are like this, and at least one
  55. plotter around here used to double as a (very strange) text
  56. printer.
  57.  
  58. The problem with this paradigm is that it takes a fair
  59. amount of history (oral or filed-away) to remember what
  60. devices are what.  Devices that come with a system are
  61. (often but not always) documented.  Devices added to a
  62. system (presumably by the field engineer who installed
  63. this funny printer) may not be, if the local users
  64. who bought the funny printer have misplaced the docs.
  65.  
  66.                 --Blair
  67.                   "Welcome to the real world."
  68.