Sometime I have the problem that an empty *.txt file (0 bytes long)
cause the view script to hang. There is a wait cursor in the browser
and nothing happens.
I found out that the
readFile function returns
undef if the
file is empty. I've changed the
readFile into the following
so that there is at least an empty string as return code.
My problem is solved with this.
# =========================
sub readFile
{
my( $name ) = @_;
my $data = "";
undef $/; # set to read to EOF
open( IN_FILE, "<$name" ) || return "";
$data = ;
$/ = "\n";
close( IN_FILE );
if (not defined $data)
{
$data = "";
}
return $data;
}
--
StefanScherer - 28 Dec 2000
This does not happen anymore since empty topics can't be saved and there is always some meta data.
--
PeterThoeny - 25 Aug 2001