This is giving problem to me Before I open this log file I noticed that the FD0 is points a pipe , may be the pipe gets closed when it comes to cleanup_register
The problem arises in following scenario 1. This changes my Apache parent process FD 0 to open to this log file. 2. Later the file is got removed , but still FD 0 points to removed file. 3. Some part of my code assumes that FD0 is STDIN and tries to open this and fails with error "Stale NFS file handle" As you suggested if i open a dummy file handle , this issue is solved. is my assumption is wrong "FD 0" is reserved for STDIN ? Shibi Ns On Wed, Jul 1, 2009 at 12:37 AM, Scott Gifford <sgiff...@suspectclass.com>wrote: > Shibi NS <shibi...@gmail.com> writes: > > [...] > > > 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. > -- --Shibi Ns--