orc@stag.UUCP (02/08/88)
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)