Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!uwm.edu!spool.mu.edu!cs.umn.edu!uc!shamash!timbuk!marc From: marc@sequoia.cray.com (Marc Bouron) Newsgroups: comp.sys.atari.st Subject: Re: Can GCC treat printer like file? Keywords: gcc Message-ID: <032147.3514@timbuk.cray.com> Date: 22 Apr 91 08:37:04 GMT References: <1991Apr19.200801.26887@ux1.cso.uiuc.edu> Reply-To: marc@sequoia.cray.com (Marc Bouron) Organization: Cray Research, Inc. Lines: 28 In article <1991Apr19.200801.26887@ux1.cso.uiuc.edu>, timothyg@ncsa.uiuc.edu (Timothy Gallivan) writes: |> |> Hi, here is a question for a real C guru. |> |> Does anyone know if gcc can treat the printer like a file? That is, |> obtain a file descriptor for the printer (fd=fopen(stdprn,..), or |> something like that), and then write to it using fwrite(...,fd) or |> putc(fd). I am aware of the TOS print routines, but I am trying to |> port some MSDOS code which treats the printer like a file. The port |> will be easier if I cam mimic this in gcc. |> There is a standard filename called `PRN:' or `LST:' that you should be able to use just like any other filename. TOS recognises this filename and directs the output to the printer. For example, you would write fopen("LST:","w"). You'll need to check yourself which one works... one is standard TOS - the other was a Lattice special. [M][a][r][c] ################################################################################ # # marc@sequoia.cray.com # . . # # Marc CR Bouron # M.Bouron@cray.co.uk (ARPA) # _|\ /|_ # # Cray Research (UK) Ltd. # M.Bouron@crayuk.uucp (DOMAIN) # (_|_V_|_) # # +44 344 485971 x2208 # M.Bouron@uk.co.cray (JANET) # | | # # # ...!ukc!crayuk!M.Bouron (UUCP) # # ################################################################################