Matt,

Matt Payton wrote:

> I want to set up a printer that will dump the output to a file.  This is
> easy enough...lp=/path/to/my/file.  The data is strictly text, with no
> special formatting or characters.  This works.  However, each time the
> output is sent to the file it is appended...I'd like the file to be
> overwritten each time, so the contents are only from the latest job.
> 
> I've tried various incantations of if=, filter=, etc.  But no luck so far.
>  Is there any way to get this to work automagically ?

Try using a wrapper script for if=. Here's a very simple script I wrote. It's
called 'fcat'. Just include it in the printcap:

test:\
        :sever:\
        :sh:\
        :if=/some/full/path/fcat:\
...etc

Here's the little script (mode 0555):

#!/bin/sh
# $Id: fcat,v 1.1 2001/06/26 14:10:15 root Exp $
set -x
exec 1>trace 2>&1
#
trap 'echo $* ; exit ${status}' 0
printer=`expr "$6" : '-.\(.*\)'`
file=output
/bin/cat > ${file}
status=$?

It leaves all args in a file called 'trace' and the printjob in 'output'
in the spooldirectory.

Hope this helps.
-- 
Henk Roose - [EMAIL PROTECTED]
CWI - Centrum voor Wiskunde en Informatica
Centre for Mathematics and Computer Science
Amsterdam (NL)


-----------------------------------------------------------------------------
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