use vars qw($default_dir);
use IO::File;
-$default_dir='/var/spool/freeside/conf';
-
=head1 NAME
FS::Conf - Read access to Freeside configuration values
use FS::Conf;
+ $conf = new FS::Conf "/config/directory";
+
+ $FS::Conf::default_dir = "/config/directory";
$conf = new FS::Conf;
- $conf = new FS::Conf "/non/standard/config/directory";
$dir = $conf->dir;
=item new [ DIRECTORY ]
-Create a new configuration object. Optionally, a non-default directory may
-be specified.
+Create a new configuration object. A directory arguement is required if
+$FS::Conf::default_dir has not been set.
=cut
sub dir {
my($self) = @_;
- $self->{dir};
+ my $dir = $self->{dir};
+ -e $dir or die "FATAL: $dir doesn't exist!";
+ -d $dir or die "FATAL: $dir isn't a directory!";
+ -r $dir or die "FATAL: Can't read $dir!";
+ -x $dir or die "FATAL: $dir not searchable (executable)!";
+ $dir;
}
=item config
=head1 BUGS
-The option to specify a non-default directory should probably be removed.
-
Write access (with locking) should be implemented.
=head1 SEE ALSO
sub exists forgot to fetch $dir ivan@sisd.com 98-sep-27
+$Log: Conf.pm,v $
+Revision 1.3 1999-03-29 01:29:33 ivan
+die unless the configuration directory exists
+
+Revision 1.2 1998/11/13 04:08:44 ivan
+no default default_dir (ironic)
+
+
=cut
1;