home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / os2 / programm / 4751 next >
Encoding:
Text File  |  1992-09-07  |  1.4 KB  |  40 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!stanford.edu!morrow.stanford.edu!news
  3. From: GG.MPD@forsythe.stanford.edu (Michael Durket)
  4. Subject: Opening LPTx in a DOS box
  5. Message-ID: <1992Sep4.213803.2479@morrow.stanford.edu>
  6. Sender: news@morrow.stanford.edu (News Service)
  7. Organization: Stanford University, California, USA
  8. Distribution: na
  9. Date: Fri, 4 Sep 1992 21:38:03 GMT
  10. Lines: 28
  11.  
  12. I have a simple test program that attempts to open
  13. a printer port via the following:
  14.  
  15.     fopen("lpt1", "w");
  16.  
  17. (Actually, don't pay any attention to the mode, I've tried
  18.  every single combination listed under the fopen call).
  19.  
  20. This is from a Microsoft C 6.0 program running in a DOS
  21. window under OS/2.
  22.  
  23. The program can never successfully open the printer - it
  24. always gets "permission denied".
  25.  
  26. I was under the impression, (from reading the redbooks) that
  27. OS/2 allowed the printer ports to be opened but through
  28. various intercepts redirected printer output from a DOS box
  29. to the Spooler. Is this not the case?
  30.  
  31. This is really bugging me, because I worked up this simple
  32. example from a rather complex program which actually manages
  33. to open the printer in one configuration of the program but not
  34. in others, and I don't see, given the above, how it could do
  35. that (the actual OS/2 printer, spooler, etc are not being
  36. changed between program runs).
  37.  
  38. Any ideas, suggestions or solutions would be greatly appreciated.
  39.  
  40.