🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.atari.st
Article #34751

Re: Printing very long lines

#34751
From: to_stdnet
Date: Fri, 28 Oct 1988 19:51
66 lines
3187 bytes
From: omni!emh@stag.UUCP (Eric Hopper)

wsflin writes:
> wsflin in <9328@watdragon.waterloo.edu>

>   The trick is that the picture is enhanced by printing each line
>3 times, which produces many overstruck characters.  My own naive
>attempt to print this picture (basically using fgetc() and fputc(),
>or fgets() and fputs(), Bconout(), etc.) fails miserably.  It prints the
>first pass of the line, some x's at the right and left margin, and
>ignores the remaining characters.  Each line in the file has >200
>characters ... the characters which are overstruck on each line
>are simply separated by spaces (ascii 32's), not '\r's ... and each
>line ends with '\n'.
>

	Depending on which version of C your using, the characters may be
being sent in "translated mode." The reason for this is the fact that
printers like \r\n for a newline, while the screen only likes \n. The
"translated mode" usually adds a \r for every \n going out, and strips all
of the \r's coming in.

	You can usually get around this translated mode with a flag in your
open command. I use Laser C, and to get around translated mode you have to
do something like:

FILE *open_file(fnme)
register char *fnme;
{
   FILE *file;
               /* The b flag sets it to "binary" or untranslated mode. */
   if ((*file = fopen(fnme, "br") == NULL)
      fprintf(stderr, "Error in opening file %s.", fnme);
   return(file);
}

for low-level access:

int open_file(fnme)
register char *fnme;
{
   int file;
         /* The O_BINARY flag sets it to "binary" or untranslated mode. */
   if ((file = open(fnme, O_RDONLY | O_BINARY)) == -1)
      fprintf(stderr, "Error in opening file %s.", fnme);
   return(file);
}

	Since you report the error even when using GEMDOS/BIOS/XBIOS routines
which have no such filtering, I think the problem must be in opening the file
to be output.


Eric Hopper (Omnifarious) Don't try to send to omni, as it is completely
unkown to any system except stag.
omni!emh@stag.UUCP  or  ....!pwcs!stag!omni!emh
/*****************************************************************************/
/* All opinions presented here are the result of my enviroment, or heredity. */
/* If you don't like them you only have yourselves or my parents to blame.   */
/*****************************************************************************/
   ____                  \* "I went insane to  */                          _
  /.  .\                 \* preserve my sanity */  /\                     /
 (  \/  )  /\/\  |/\  .  \* for later."        */  |   _          _       \
  \____/  |    | |  | |    \*  Ford Prefect  */   --- / \  |/\ . / \ | |   \
                            \****************/     |  \_/\ |   | \_/ \_/\ _/
 /****************************************************************************/
Technical Details
Message-ID: <635@stag.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ncar!tank!nic.MR.NET!shamash!nis!ems!pwcs!stag!daemon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!ncar!tank!nic.MR.NET!shamash!nis!ems!pwcs!stag!daemon
From: to_stdnet@stag.UUCP
Newsgroups: comp.sys.atari.st
Subject: Re: Printing very long lines
Message-ID: <635@stag.UUCP>
Date: 28 Oct 88 19:51:10 GMT
Sender: daemon@stag.UUCP
Lines: 66