Port Redirection in Fedora

James Wilkinson fedora at aprilcottage.co.uk
Thu Aug 31 12:09:46 UTC 2006


R. G. Newbury wrote:
> Well that's part of the idea. I have a DOS program (accounting) which can only 
> write out to LPT1, LPT2 or to a file. The latter is a pain. I used to use 
> redirection to divert the output which the program thought it was sending to 
> LPT2, to a networked printer.
> I'm looking for something to do the same thing under Fedora 5.

Three things:

How are you running this DOS program under Linux? Have you re-compiled,
or are you using something like dosemu, qemu, or wine? As if it's the
latter, you may be able to set LPT1 in the configuration file.

Or you may just find that adding a networked printer and calling it LPT2
works fine.

Thirdly, Unix filenames can be "fifo"s or "named pipes". In your case,
you could set up a program to read anything that came from the fifo,
print to the filename, and the data would be set to the waiting program.
I haven't tested this fully, but something like
rm /tmp/fifo # make sure there's nothing already there
mkfifo /tmp/fifo
lp -d printername </tmp/fifo & # & keeps the lp command running
~/dos/program.exe

should allow you to "print" a file to /tmp/fifo and have them come out
where you want.

One other, fairly obvious thing: please remember to change the subject
line back if you're going to respond to a digest? Otherwise your message
gets "lost".

You may find a MIME digest suits your needs better: you can change
options at the unsubscribe web page: the link is in the digest footer.

Hope this helps,

James.
-- 
E-mail:     james@ | A: Because people don't normally read bottom to top.
aprilcottage.co.uk | Q: Why is top-posting such a bad thing?
                   | A: Top-posting.
                   | Q: What is the most annoying thing in e-mail and usenet?




More information about the fedora-list mailing list