home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / windows / openloo / 4477 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.2 KB

  1. Path: sparky!uunet!gossip.pyramid.com!pyramid!unify!openlook!openlook-request
  2. From: fgreco@cfdev1026.shearson.com (Frank Greco)
  3. Newsgroups: comp.windows.open-look
  4. Subject: Re: Printing from within an Xview program
  5. Message-ID: <u0pci8t@openlook.Unify.Com>
  6. Date: 12 Nov 92 18:02:40 GMT
  7. Sender: news@Unify.Com
  8. Distribution: world
  9. Lines: 22
  10.  
  11. > What is the prefered mechanism for an Xview program sending something to the
  12. > printer?  I would typically want to gen a file, and then do a
  13. > system call to lpr...
  14. >     sprintf(command, "lpr %s", filename);
  15. >     system(command);
  16. > The Xview documentation however warns against directly using system
  17. > calls because of confusions with the Notifier.  I could have the
  18. > program fork, and then do an exec call, but that seems like a lot
  19. > of effort for the system to go through for such a simple task.
  20.  
  21.     You don't want to system() this.  You just want to "fork it
  22.     off".  There's an example of how to do this in the XVPM.  In an
  23.     non-windowing environment, you should only use system() only if
  24.     you need the shell's help.
  25.  
  26.     It would be nice for Sun to give us a nice alternative to system()
  27.     for XView.  Or perhaps the devguide folks could do this.
  28.  
  29.     Frank G.
  30. =-=-=-=-=-=-=-=-=-=
  31.