(RADIATOR) Possible bug in Radiator 3.5+patches Util.pm on Win2k
Valentin Tumarkin
tv at xpert.com
Tue Mar 11 06:57:56 CST 2003
Hi,
There seems to be a bug in Radiator 3.5 + latest patches on
Win2k OS in Util.pm. I haven't checked if the problem also
exists on Unix.
The problem is in the Util.pm 'append' sub. The 'mkdir' fails on
dir/filename starting with '>>' (the real problem could be that
'dirname' doesn't understand filenames that start with '>>').
The simple solution is to move the line that prepends the append
redirection sign '>>' to filename after the 'mkpath'.
Original:
sub append
{
my ($filename, $line) = @_;
# Permit pipes
$filename = ">>$filename" unless $filename =~ /^\|/;
# Make sure the files directory exists.
mkpath(dirname($filename), 0, 0755)
unless -d dirname($filename);
open(FILE, $filename) || return;
print FILE $line;
close(FILE) || return;
return 1;
}
Fixed:
sub append
{
my ($filename, $line) = @_;
# Make sure the files directory exists.
mkpath(dirname($filename), 0, 0755)
unless -d dirname($filename);
# Permit pipes
$filename = ">>$filename" unless $filename =~ /^\|/;
open(FILE, $filename) || return;
print FILE $line;
close(FILE) || return;
return 1;
}
Best Regards,
Valentin
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list