Re: Tempfile and send_fd()

2000-11-17 Thread Roger Espel Llima
barries [EMAIL PROTECTED] wrote: On Fri, Nov 17, 2000 at 03:51:35PM +1100, Steve Smith wrote: seek $f, 0, 0; Had a look in Apache::File (below), and it sysopens, so you might want to sysseek(...) instead. Just to clear up one thing: sysopen() doesn't actually belong to the sys* family

Re: Tempfile and send_fd()

2000-11-17 Thread barries
On Fri, Nov 17, 2000 at 03:51:03PM +0100, Roger Espel Llima wrote: Internally sysopen() does a plain libc open(), but then it follows with a fdopen() call to get a stdio handle anyway. That explains the results I saw, thanks. - Barrie

Tempfile and send_fd()

2000-11-16 Thread Steve Smith
Hi, Could somebody tell me why the following testcase doesn't work? use Apache (); use Apache::File (); my $r = Apache-request(); $r-content_type('text/plain'); $r-send_http_header(); my $f = Apache::File-tmpfile(); print $f "test\ntest\n"; $r-send_fd($f);

Re: Tempfile and send_fd()

2000-11-16 Thread barries
On Fri, Nov 17, 2000 at 02:42:43PM +1100, Steve Smith wrote: Hi, All I get is an empty document. My understanding is that the data written to the tmpfile should be available immediately through the filehandle even if it hasn't been flushed. I wouldn't bet on it flushing: mod_perl may not

Re: Tempfile and send_fd()

2000-11-16 Thread barries
On Fri, Nov 17, 2000 at 03:51:35PM +1100, Steve Smith wrote: "Steve" == Steve Smith [EMAIL PROTECTED] writes: Hi, Could somebody tell me why the following testcase doesn't work? snip Nevermind, I got it from the archives eventually : seek $f, 0, 0; Had a look in

Re: Tempfile and send_fd()

2000-11-16 Thread barries
On Fri, Nov 17, 2000 at 12:32:33AM -0500, barries wrote: On Fri, Nov 17, 2000 at 03:51:35PM +1100, Steve Smith wrote: seek $f, 0, 0; Had a look in Apache::File (below), and it sysopens, so you might want to sysseek(...) instead. No, nevermind, don't: sysseek won't flush