Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!ztivax!tumuc!guug!pcsbst!cochise!roland From: roland@cochise Newsgroups: comp.sys.atari.st Subject: Re: I/O redirection to the printer Message-ID: <1174@pcsbst.UUCP> Date: 19 Dec 89 09:45:06 GMT References: <"89-12-15-19:19:25.76*UI0T"@DKAUNI2.BITNET> Sender: uusr@pcsbst.UUCP Lines: 25 Hallo Thomas, UI0T@DKAUNI2.BITNET ("Thomas Koenig") writes: >I am having a strange problem with I/O redirection. To redirect >standard output to the printer, I wrote the following test program: I think You just re-discovered one of the older bugs of TOS. I have hit upon this problem when trying to redirect the messages from Turbo-C ( commandline version ) to a file. For the compiler TCC this worked fine, however, the linker put out only NULs. ( Substituting ALN as linker solved this problem. ) A little disassembling showed that the linker used Cconout() for basic output, whereas TCC relied on Fwrite( 1, ... ). > Fclose (1); > Fforce (1, printhandle); > printf("Hello, world!\n"); >/* Cconws("Hello, world!\n"); */ So try: Fwrite( 1, "Hello world!\n", 13 ) ; /* modulo correct ordering */ ( This should work, and I suppose that the printf() is based on F