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

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 10/25/20 8:12 PM, Marshall Lake wrote:
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 https://freemint.github.io/tos.hyp/en/gemdos_file.html#Fopen 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.

There's nothing Hatari related in this.  Pipes
are an OS level concept.

Pipes don't exist in Atari TOS, because they're
pretty much pointless in single-tasking OSes.
You need a multitasking operating system, like
MiNT.

I don't think there's 'lpr' program for TOS
either, I'm pretty sure that's only available for
MiNT (and other Unix-like operating systems).


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

Just to make sure there's no confusion...

Hatari is not a Linux distribution, or operating
system. It's an emulator for old Atari hardware.


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.

If you want, you can run m68k Linux under Hatari.

There are some complications though, see:
https://hatari.tuxfamily.org/doc/m68k-linux.txt


	- Eero

(IMHO about only reasons to run Linux under Hatari
are testing Hatari HW emulation, easier debugging
of Linux kernel issues on m68k, especially related
to cache & interrupt handling, and improving Linux
user-space code to work better on original HW.)



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/