On the topic of FHs, I have a CGI script that opens a file handle and then
in the HTML code I print out the results -

open(FH, "grep blahblah /usr/local/apache/log |");

print "<html>\n";
etc..
while <FH>{
    print "$_ <br>";
}
etc..
print "</html>";

Now my problem is how do I time out the grep command?? Sometimes one of the
files that it runs against takes forever to mount (automount). Also the logs
are so big that grep runs forever - is there anyway to stop it, besides
getting on the box and killing the PID?






-----Original Message-----
From: Todd Wade [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 06, 2002 7:50 PM
To: [EMAIL PROTECTED]
Subject: Re: What could go wrong with closing an FH ?



"David Vd Geer Inhuur Tbv Iplib" <[EMAIL PROTECTED]> wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi All,
>
> After a couple of emails about opening a file with a lower case FH, I have
a
> question. I see everyone opening a file with an "or die" statement, what I
can
> fully understand. But I see you also close the FH with an "or die"
statement.
>
> Why ? What can go wrong with closing an FH ?
>
> Can anyone tell me the answer ? I am much interested.
>

The two major ones I can think of off the top of my head is if the disk
fills up or you are writing to a file on a network disk and the connection
goes goes down. In both circumstances your data was lost and you would want
to know about it. There are many others.

Todd W.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to