Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mordor!sri-spam!rutgers!im4u!ut-sally!utah-cs!utah-gr!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.sys.atari.st Subject: Re: Print redirection routine Message-ID: <15@obie.UUCP> Date: 2 Feb 88 06:15:50 GMT References: <8801271313.AA10750@lasso.laas.fr> Organization: UinTech, Layton, UT Lines: 32 Summary: C code fragment to redirect console/printer output In article <8801271313.AA10750@lasso.laas.fr>, ralph@lasso.UUCP (Ralph P. Sobek) writes: > = = = = = = = = = = = = = : > To: inria!score.stanford.edu!info-atari16 > Subject: Print redirection routine > > what I'm looking for is an assembler or C program which would redirect > the output of one of these programs to an ascii file rather than the printer. You can redirect the output to printer in your program via the following: #define PRN 3 #define NULL ((char *) 0L) ... /* Put the command parameters in tail[1...]. tail[0] should equal the number of characters in the command tail, up to 127 (I think - it seems to work). */ char tail[128]; ... /* Force the printer handle to point to the disk file instead. */ Fforce(PRN, "disk:/file/name/path.ext"); /* Now execute the program, the standard handles are inherited. */ Pexec(0, "disk:/program/name/path.prg", NULL, tail); .... Hope this helps whoever it was!