This is the mail archive of the
mailing list for the Cygwin project.
Re: printing from within Cygwin
- From: Rick Rankin <rick_rankin at yahoo dot com>
- To: Fred_Smith at computrition dot com
- Cc: cygwin at cygwin dot com
- Date: Fri, 30 Aug 2002 20:26:10 -0700 (PDT)
- Subject: Re: printing from within Cygwin
I asked about your version of lpr because there are versions out there other
than the one that comes in the cygutils package. The version that comes with
cygutils supports the -P option to define the printer device (-d is an alias
for -P). It also supports the PRINTER environment variable. So, for example,
you can add the line
in your .bash_profile (or /etc/profile or your native NT environment or ...) to
set your default printer. You can also set up your own name for a local or
remote printer when you set it up via the normal NT mechanisms, then use that
name as the value of your printer environment variable. That's what I do --
that way I don't have to fool with the backslashes.
BTW, I have an updated version of lpr that supports forward slashes in the
printer name as well as some support for lpt1 type device names. I'm just
waiting for Chuck to get back to get it into the next release of cygutils.
--- Fred_Smith@computrition.com wrote:
> Rick, thanks for the reply.
> At the moment I'm using NT4.x. In the future it could be nearly anything,
> but I'm going to try to constrain it to nothing less than NT 4.x.
> I'm using whatever the lpr command is that I got when I installed cygwin, I
> don't see any options anywhere to change that. In fact I don't even see lpr
> listed in any of the cygwin info on the web page, so I'm not at all sure
> what it is.
> 'which lpr' shows /usr/bin/lpr
> and "ls -l /usr/bin/lpr" shows lpr.exe to be 7680 bytes.
> As to which printer, I'd like to (at a minimum) be able to print to the
> NT-defined default printer, but better would be to figure out how lpr maps
> into windows printers so I can tell it which printer to actually use.
> As you may be able to tell I'm not real familiar with either Cygwin, or
> NT., so the NT printing susbystem is largely a black hole to me.
> Rick Rankin <firstname.lastname@example.org> on 08/30/2002 03:21:51 PM
> To: Fred Smith/Computrition, email@example.com
> Subject: Re: printing from within Cygwin
> Which lpr are you using, which OS (9x or NT/2K/XP), and are you trying to
> to a locally attached or a network printer?
> --- Fred_Smith@computrition.com wrote:
> > Trying to figure out how to print from a Cywin (console) app.
> > Porting a Linux app to cygwin. On Linux it uses popen() to pipe output to
> > shellscript which in turn cats its input to lpr (it may do other things,
> > and may transform the data, but that's the ultimate goal).
> > trying to figure out how to do something akin to that under cygwin.
> > Invoking "lpr <filename>" at the command prompt comes back with an error
> > message:
> > can't open 'prn' for writing.
> > Advice would be appreciated. (I hope you're not going to tell me I need
> > learn all about the innards of windoze printing!)
> > Thanks!
> > Fred
> > --
> > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> > Bug reporting: http://cygwin.com/bugs.html
> > Documentation: http://cygwin.com/docs.html
> > FAQ: http://cygwin.com/faq/
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html