Re: [hatari-devel] Printing Directly to a Printer

[ Thread Index | Date Index | More Archives ]

On Sun, 25 Oct 2020, Thomas Huth wrote:

Am Tue, 20 Oct 2020 16:37:24 -0700 (MST)
schrieb Marshall Lake <marshallelake@xxxxxxxxx>:

Can the following be used in Hatari to print directly to a printer ?

     char buf[77];
     FILE *lpr;

     lpr = popen ("lpr", "w");
     fprintf (lpr, "%s", buf);
     pclose (lpr);

That certainly requires FreeMiNT and depends on your setup of your "lpr" program.

If you just want to send some ASCII character to the parallel port, it might be better to use the "PRN:" pseudo-file with Fopen() instead. See for details.

I don't quite understand, but that is probably due to my lack of knowledge of the Hatari code (I have 0 knowledge). I don't understand why the code would rely upon FreeMiNT.

I also do not have much knowledge of the various Linux distros.  But ...

I'm under the impression that lpr is a standard facility across distros. I'm involved in a Linux-only project which uses lpr/popen to print ASCII text and there's never been a complaint that printing doesn't function properly.

Marshall Lake -- marshallelake@xxxxxxxxx --

Mail converted by MHonArc 2.6.19+