Article View: comp.sys.atari.st
Article #30584Fforce() example.
From: ihnp4!pell!orc
Date: Mon, 08 Feb 1988 07:02
Date: Mon, 08 Feb 1988 07:02
38 lines
1468 bytes
1468 bytes
In an article a day ago (sorry, STadel doesn't give me message ID's --
thank god!), wes@obie.UUCP said something about using Fforce() to redirect
i/o. Well, his example was wrong. Fforce is passed two file descriptors and
it forces the first one to point at the second one, like so:
/*
* redirect printer output into a file
*/
foo = Fcreate("a:\printer.out", 0);
save= Fdup(PRN); /* wanna save the old printer... */
if (Fforce(PRN,foo) == 0) {
/*
* do printer stuff
*/
Fclose(PRN);
Fforce(PRN,save);
Fclose(save);
Fclose(foo);
}
else
Cconws("ACK! Can't redirect the printer!\r\n");
(I hate so see this already brain-dead OS subjected to further indignities :-)
---------------------------
jsm@laird: HI! Yes, your stuff is making it to usenet. Call Pell one
of these days and you might see something you posted in the
comp.sys.atari.st) room.
-orc
-david parsons
-ihnp4!pell!orc
-orc@pell (US 6123779239 3/12/2400 baud)
Technical Details
Message-ID:
<331@stag.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!rosevax!ems!nis!stag!daemonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!rosevax!ems!nis!stag!daemon From: ihnp4!pell!orc@stag.UUCP Newsgroups: comp.sys.atari.st Subject: Fforce() example. Message-ID: <331@stag.UUCP> Date: 8 Feb 88 07:02:55 GMT Sender: daemon@stag.UUCP Lines: 38