Le mercredi 3 janvier 2007 17:24, Nicolas Costes a écrit :
> ---------------------------------------------------------------
> # If we were called with 5 arguments, read from STDIN to a tempfile:
> if (@ARGV == 5){
> # TODO : This is not portable, use File::Temp instead !
> my $tmpcmd = "/bin/mktemp </dev/null ".
$ENV{"TMPDIR"}."/print.XXXXXX";
> $tmpfile = qx{$tmpcmd};
> chomp $tmpfile;
> # TODO : This is not portable too !
> qx{cat > $tmpfile};
>
> # ...And set $tmpfile to be the document to print
> $doc = $tmpfile;
> log_debug (" Called with 5 args, \$doc is read from STDIN and the
> tempfile is $doc");
> }
> ---------------------------------------------------------------
Ok, this code has been changeed to the following :
---------------------------------------------------------------
# If we were called with 5 arguments, read from STDIN to a tempfile:
if (@ARGV == 5){
# TODO : Validate this works, and add some comments !
use File::Temp;
use File::Copy;
my ($tempfh,$doc)=mkstempt("jasmine_XXXXXXXX", $ENV{"TMPDIR"});
copy(\*STDIN, $tempfh);
log_debug (" Called with 5 args, \$doc is read from STDIN and the
tempfile is $doc");
}
---------------------------------------------------------------
...And should be more portable, and why not safer ;-)
You can download the entire file here :
http://svn.berlios.de/svnroot/repos/jasmine/trunk/JASmine-Backend/jasmine
Give it a try, and tell me if this was sufficient to fix it for you...
--
Put JASmine in your Cups !
To unsubscribe :
mailto:[EMAIL PROTECTED]
List archives :
http://dir.gmane.org/gmane.comp.printing.jasmine.user
http://www.mail-archive.com/jasmine%40ml.free.fr/
Web site :
http://jasmine.berlios.de/