This allows to specify configuration options, like
memdisk.image as simple symlinks directly to files
write_file $path, $default;
warn "default $path = $default";
$value = $default;
+ } elsif ( -l $path ) {
+ $value = readlink $path;
} elsif ( -f $path ) {
$value = read_file $path;
chomp $value;
foreach my $file ( glob("$path/*"), glob("$path/*/*") ) {
my $name = $file;
$name =~ s{^$path/+}{} || die "can't remove $path from $name";
- $conf->{ $name } = read_file $file if -f $file;
+ $conf->{ $name } =
+ -l $file ? readlink $file :
+ -f $file ? read_file $file :
+ '?';
}
return $conf;
}