On Mon, Jun 28, 2004 at 04:01:02PM -0500, Sam Warren wrote:
> I was trying to implement PrintBill and found that it didn't work due to
> the fact that PrintBill looks for control files, which LPRng no longer
> uses. Is there a workaround that anyone knows of? Thanks!
> 
> Sam Warren, Jr.
> Computer Analyst
> Winnebago Industries
> 641-585-3535 x7785 
> 

Yes there is.

The hold file contains all of the control file data,
together with statistics and other stuff you might want.

If you have a pointer to the PrintBill code,  I might be able to
make a quick suggestion.

I had a stupid simple perl script that converts the hold file
information to a classical control file.  If you want, I can
dig it up.

It was something like:

my $cf = "";
my $all_info = {};
while( <> ){
        my($key,$value) = split('=',$_,2);
        $all_info->{$key} = $value;
        if( $key =~ /[A-Z]/ ){
                $cf . = "$key$value";
        } elsif( $key eq 'hfdatafiles' ){
                # if you want the data file
                my @files = split( "\001", $_ );
                foreach my $line (@files) {
                        my $info = {};
                        foreach my $kv (split("\002",$line) ){
                                my($key,$value) = split( '=',$kv, 2);
                                $info->{$key} = $value;
                        }
                        # now you can get the various key and values for the data 
files.
                        $cf.= 'N'.$info->{N} if $info->{N};
                        my $copies = $info->{copies};
                        for( my $i = 0; $i < $copies; ++$i ){
                                $cf.= $info->{format}.$info->{transfername}."\n";
                        }
                }
        }
}

# - here is the hold file
[EMAIL PROTECTED]
C=A
cftransfername=cfA558h110.private
copy_done=0x1
D=2004-06-28-15:51:09.827
datafile_count=1
done_time=0x40e0a0e7
file_hostname=h110.private
filenames=/tmp/hi
H=h110.private
held=0x0
hf_name=hfA558
hfdatafiles=copies=0x1dftransfername=dfA558h110.privateformat=fN=/tmp/hisize=3
hold_class=0x0
hold_time=0x0
J=/tmp/hi
job_time=0x40e0a0dd
job_time_usec=0xcb0d7
L=papowell
number=558
P=papowell
printable=0x1
priority=A
Q=t1
remotehost=localhost.private
remoteport=0x0
remove_time=0x40e0a0e7
server=0
size=3                        <- this is the 'real' job size, i.e. copies * file size.
start_time=0x40e0a0dd
unixsocket=0x1
update_time=2004-06-28-15:51:19.918
Z=list=3

-- 
Patrick Powell                 Astart Technologies
[EMAIL PROTECTED]            6741 Convoy Court
Network and System             San Diego, CA 92111
  Consulting                   858-874-6543 FAX 858-751-2435
LPRng - Print Spooler (http://www.lprng.com)



-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRng MAILING LIST
The address you post from or your Reply-To address MUST be your
subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.
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,  call Patrick Powell or one of the friendly
staff at Astart Technologies for help.  Astart also does support for LPRng.
Also, check the Web Page at: http://www.lprng.com for any announcements.
Astart Technologies  (LPRng - Print Spooler http://www.lprng.com)
6741 Convoy Court
San Diego, CA 92111
858-874-6543 FAX 858-751-2435
-----------------------------------------------------------------------------

Reply via email to