Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Re: File Descriptor used by FileHandle under mod_perl 2.0.4 - is it
a perl/mod_perl bug ?

Scott Gifford

2009-06-30

Replies: Find Java Web Hosting

Author LoginPost Reply
Shibi NS <shibi.ns@(protected):

[...]

> my $log = new FileHandle("process.log", "a");
>
> When I print the $log->fileno it print FD as 0 and I have couple other log
> files opened after this all of these having random numbers like 12,15 etc. my
> believe is FD 0 used for STDIN . Is this is bug or aim doing
> something wrong ?

If you have closed FD 0, the next file opened will get that file
descriptor. If that's the case, one solution is to open /dev/null
after closing FD 0; another is to just let the FD be 0, as long as it
works.

----Scott.
©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.