https://bugs.winehq.org/show_bug.cgi?id=39056
Bug ID: 39056 Summary: Redirect a device printer port to a print command (lpr) Product: Wine Version: 1.7.48 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: spooler Assignee: wine-bugs@winehq.org Reporter: hugocanalli@gmail.com Distribution: ---
Sometimes I need to write directly to a print port. That's because I have a old program that works only with ports named lpt[1-4] or com[1-4]
I can do it creating a link to my device to the dosdevices folder. E.g: ln -s /dev/lp0 ~/wine/dosdevices/lpt1 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/lpt2
Typing commands like echo 'hello' > lpt1 will work great.
There are some cases that my printer is not directly connected to my computer. By example my Brother DCP-8085DN printer that works over network, a wireless printer, or same my epson lx300 using lpt1 port but instead is installed on another computer. To map this kind of printers I use cups and it work on wine using print dialog (e.g printing using notepad). But what about if I need to use my old dos program or would like play around with wine start.exe program and type commands like echo 'hello' > lpt1 Wine start.exe returns File not found.
Cups doesn't create /dev/xxx devices to printers. So I can't do a link to dosdevices folder and I have to use the lpr command to print. One solution is create a file named lpt1 on dosdevices folder and use loop script in linux cheking for changes and redirect data to lpr. I can do it easly using the following procedure: cd ~/.wine/dosdevices mkfifo lpt1 chmod 666 lpt1
And create a running forever script like:
while true do cat ~/.wine/dosdevices/lpt1 | lpr -o raw -P cups_printer_name done
While this method can work would be great if we could do it only using wine ways and therefore no need to such script.