1847202 Members
3479 Online
110263 Solutions
New Discussion

Print Jobs Info

 
robin uy
Occasional Contributor

Print Jobs Info

I am writing a Print Utility script. One feature is to display the contents of a print job. I look at /var/spool/lp/request/ and saw pairs of files with these name patterns:
cA9999unix01
dA9999unix01
The content of the first file contains among others, these info:
FdA2372unix01
fdA2372unix01
UdA2372unix01
Is any of these lines the clue to the file name of the print job?
The other question is the file name pattern - do they always begin with cA and dA ?
Thanks in advance for any insights anyone can provide.
1 REPLY 1
John Palmer
Honored Contributor

Re: Print Jobs Info

Hi Robin,

If you are after the name of the filename that was specified in the lp command then it is held in the 'c...' file in a record of the form:-
T

This seems to be followed by 'F', 'f' and 'U' records all of which refer to the 'd...' file which is the actual data to be printed.
Finally the filename is repeated in a record
N

Note that a null filename is interpreted by lpstat as 'Standard input'.

A typical 'c...' file would look something like:-

H
P
J
C
L
B
K1
O
T
FdAnnnn
fdAnnnn
UdAnnnn
N
T
FdBnnnn
fdBnnnn
UdBnnnn
N
...
A0

It looks as though the request information file is always of the form 'cAnnnn'
but the data files appear to increment the second letter for each file that was specified to the lp command:-
dAnnnn for file 1
dBnnnn for file 2
dCnnnn etc

The above information is from observation, I have never found any official documentation.

Hope it's of some use.
John