> From [EMAIL PROTECTED] Sun Jun 25 23:31:32 2000
> Date: Sun, 25 Jun 2000 22:28:31 -0700 (PDT)
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: HP DeskJet 930C anyone?  How to determine capabilities?
> From: [EMAIL PROTECTED]
>
> from the quill of [EMAIL PROTECTED] on scroll
> <[EMAIL PROTECTED]>
> > 
> > Actually,  the 'dumbness' comes from the fact that there is
> > no way to request status information using PCL,  so you might as
> > well not ask for it.
>
> I realize that.  The printer model "pcl" only includes PCL capabilities
> and excludes PJL capabilities altogether.  I understand that.  What I am
> asking is whether there is an effective method of testing for the
> presence of any PJL at all if is so discovering (even if by trial and
> error) what commands are supported.

No.  Sorry, been down that path and it runs over a cliff.

> OK.  But under what circumstances does lpd know to whether to open
> read/write or write only?  Presumably lpd is making a choice somewhere,
> somehow when it does the open.

if the :rw flag is set and the device is not a file then it opens it RW.
Now sockets are always RW,  so even if you use FCNTL to get the
flags,  you get a RW indication.  However,  sometimes the device
does not always return status information,  so you have to tell
the lower levels that it does not.  This is,  as they say,  a pain.

>
> > Now if anybody knows a way to find out the allowed operations
> > (or if it was open READ/WRITE/ or APPEND) using some system calls,
> > please tell me.  Even if they are not portable,  I will put them
> > into the code base.
>
> fcntl() will tell you what flags are set on an FD, including whether it
> is O_WRONLY or not.  Here is a line from an strace of lpd on linux:
>
> fcntl(3, F_GETFL)                 = 0x1 (flags O_WRONLY)
>
> and if strace can determine that O_WRONLY so should lpd be able to.
>
> But I am sure you know all of this, so I must be missing something
> blindingly obvious.

No, perhaps not.  I will look at this again.  But it may only be on
Linux systems,  which is still better than nothing.

Patrick

-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to