Network Printer Status

Does anybody have any code or can point me to some code that I can use to
query a network printer for its status. We are using lpd to do the printing
in case that matters.

Thanks,

Brown, Richard <brownr@aecl.ca> wrote:

Does anybody have any code or can point me to some code that I can use to
query a network printer for its status. We are using lpd to do the printing
in case that matters.

FILE *fp;
fp = popen( “lprc status printername”, “r”);
while ( fgets(…, fp) {
process_buffer();
}

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs wrote:

Brown, Richard <> brownr@aecl.ca> > wrote:
Does anybody have any code or can point me to some code that I can use to
query a network printer for its status. We are using lpd to do the printing
in case that matters.

FILE *fp;
fp = popen( “lprc status printername”, “r”);
while ( fgets(…, fp) {
process_buffer();
}

This will report what lpd thinks is useful and current; I think this

is always what is contained in the file /usr/spool/lpd//status.
Parts of the path may depend on your setup. You might see “sending to
hp4000” for example, long after the job is finished if lpd had no
need to update this info.

Richard

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.