in reply to Tar File To Web Browser
If the filehandle is STDOUT (already opened by web server), that sysseek fails, and _get_handle returns nothing, leading to the errors above. Running this under tests from a normal commandline (thanks Fastolfe), STDOUT is opened freshly and the sysseek succeeds (which is why a lot of tests from the commandline doing the exact same thing worked).sub _get_handle { my ($fh, $flags, $mode); sysseek ($_[0], 0, 0); or goto &_drat;
Removing the goto (?!) appears to let sysseek silently fail. If it can get to the beginning, it will, no harm, no foul. If it can't (like in the environment I'm working in), then it just continues on and prints the data successfully. Does that solution seem okay? What are the pitfalls with going with this solution?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The Problem & My Solution (please comment)
by Fastolfe (Vicar) on Dec 11, 2000 at 00:52 UTC | |
by tilly (Archbishop) on Dec 11, 2000 at 03:53 UTC | |
|
Re: The Problem & My Solution (please comment)
by a (Friar) on Dec 11, 2000 at 10:07 UTC |