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