Print sequence

Hello

I use the following code to print from my code:

pFp = popen( “lpr -P{Printer}”, “w” );
fprintf( pFp, “bla bla bla…” );
pclose( pFp );

Usually this works fine. Now I had an occasion where successive print jobs
were printed in a different order, like:

Input to spooler: 1 2 3 4 5 6 7 8 9 10
Output to printer: 1 2 3 >7 8< 4 5 6 9 10

Shouldn’t lpd keep the order of the print jobs or is it free to choose any
print job from spool directory? Is it dependent on the result of readdir()?

How could the sequence be insured because it is very critical to the
application?

Contents of /etc/printcap

Printer on Network (hostname=bopprt)

BopPrt:
:lp=:rm=bopprt:sh:tr=\f:sd=/usr/spool/output/BopPrt:

Thanks a lot
Markus

Ping …

“Markus Jauslin” <markus.jauslin@ch.mullermartini.com> schrieb im
Newsbeitrag news:b2cu0h$921$1@inn.qnx.com

Hello

I use the following code to print from my code:

pFp = popen( “lpr -P{Printer}”, “w” );
fprintf( pFp, “bla bla bla…” );
pclose( pFp );

Usually this works fine. Now I had an occasion where successive print jobs
were printed in a different order, like:

Input to spooler: 1 2 3 4 5 6 7 8 9 10
Output to printer: 1 2 3 >7 8< 4 5 6 9 10

Shouldn’t lpd keep the order of the print jobs or is it free to choose any
print job from spool directory? Is it dependent on the result of
readdir()?

How could the sequence be insured because it is very critical to the
application?

Contents of /etc/printcap

Printer on Network (hostname=bopprt)

BopPrt:
:lp=:rm=bopprt:sh:tr=\f:sd=/usr/spool/output/BopPrt:

Thanks a lot
Markus
\

Looks that I’m left alone 8-{
Please help!

“Markus Jauslin” <markus.jauslin@ch.mullermartini.com> schrieb im
Newsbeitrag news:b2cu0h$921$1@inn.qnx.com

Hello

I use the following code to print from my code:

pFp = popen( “lpr -P{Printer}”, “w” );
fprintf( pFp, “bla bla bla…” );
pclose( pFp );

Usually this works fine. Now I had an occasion where successive print jobs
were printed in a different order, like:

Input to spooler: 1 2 3 4 5 6 7 8 9 10
Output to printer: 1 2 3 >7 8< 4 5 6 9 10

Shouldn’t lpd keep the order of the print jobs or is it free to choose any
print job from spool directory? Is it dependent on the result of
readdir()?

How could the sequence be insured because it is very critical to the
application?

Contents of /etc/printcap

Printer on Network (hostname=bopprt)

BopPrt:
:lp=:rm=bopprt:sh:tr=\f:sd=/usr/spool/output/BopPrt:

Thanks a lot
Markus
\

I am not an authority, but here are some questions that may help:

Does the job show in the queue when popen() is called or when pclose()
is called?

Is there more than one process printing to the queue, or more than one
“thread” in the printing process? If so, then the question above may be
important if the start and stop times for different jobs overlap.

Can you know ahead of time when this will happen? If so, you could shut
down the printer and examine the file times of the jobs and compare them
to the sequence numbers to see if anything interesting shows up. Or you
might write a little script that logs the contents of the spool
directory every so often so that you have some data to examine when
things have messed up.

Richard

Markus Jauslin wrote:

Looks that I’m left alone 8-{
Please help!

“Markus Jauslin” <> markus.jauslin@ch.mullermartini.com> > schrieb im
Newsbeitrag news:b2cu0h$921$> 1@inn.qnx.com> …

Hello

I use the following code to print from my code:

pFp = popen( “lpr -P{Printer}”, “w” );
fprintf( pFp, “bla bla bla…” );
pclose( pFp );

Usually this works fine. Now I had an occasion where successive print jobs
were printed in a different order, like:

Input to spooler: 1 2 3 4 5 6 7 8 9 10
Output to printer: 1 2 3 >7 8< 4 5 6 9 10

Shouldn’t lpd keep the order of the print jobs or is it free to choose any
print job from spool directory? Is it dependent on the result of

readdir()?

How could the sequence be insured because it is very critical to the
application?

Contents of /etc/printcap

Printer on Network (hostname=bopprt)

BopPrt:
:lp=:rm=bopprt:sh:tr=\f:sd=/usr/spool/output/BopPrt:

Thanks a lot
Markus



\