darren chamberlain wrote:
> Todd Caine ([EMAIL PROTECTED]) said something to this effect:
> > I've got a Perl Module which has a function called
> > RRDs::graph($args), that will only print to stdout. In my
> > handler I write something similar to:
>
> STDOUT is where $r->print goes under mod_perl; you should be OK.
The data that is printed out via $r->print is on the file descriptor that the
http request is set up on. If the HTTP request came in on file descriptor 3
then $r->print('foo') prints to file descriptor 3; not stdout(file descriptor
1, on my system).
>
>
> Failing this, does RRDs::graph print explicitly to STDOUT, or just to
> the currently selected filehandle? If the latter (it probably is),
> just select a a different filehandle, and then call &graph.
>
RRDs::graph is perl wrapper for the RRDTool utility written in C. It
explicitly prints to 'stdout'. I've tried selecting on a different file
descriptor like this:
my $c = $r->connection;
my $fd_num = $c->fileno(0);
select($fd_num);
And I get "The document contained no data".
The only way I can get part of gif to the browser was to do this:
my $c = $r->connection;
my $fd_num = $c->fileno(0);
open(STDOUT, ">&$fd_num");
RRDs::graph($args);
But the data is incomplete. Even when I autoflush the $fd_num.
There has got to be a better way.....
Thanks for your thoughts,
Todd
>
> (darren)
>
> --
> Without deviation from the norm, 'progress' is not possible. -- Frank Zappa
--
--------------------------------------------------------------
<!-- Todd Caine - [EMAIL PROTECTED]
Electric Lightwave, Inc.
4400 NE 77th Avenue
Vancouver, WA 98662
Direct Dial: (360) 816-4344 //-->
--------------------------------------------------------------