From: pcanterino <> Date: Sun, 7 Nov 2004 20:42:19 +0000 (+0000) Subject: Check if the root directory exists X-Git-Tag: version_2_2~13 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/0e297c178531651238c91bc1e62dcb7dd356e541?hp=91dc65a53fbe7dc79a983a51f330033b343cba36 Check if the root directory exists --- diff --git a/devedit.pl b/devedit.pl index c29c22e..eccebd0 100644 --- a/devedit.pl +++ b/devedit.pl @@ -6,7 +6,7 @@ # Dev-Editor's main program # # Author: Patrick Canterino -# Last modified: 2004-11-04 +# Last modified: 2004-11-07 # use strict; @@ -35,6 +35,10 @@ use constant CONFIGFILE => 'devedit.dat'; my $config = read_config(CONFIGFILE); error_template($config->{'templates'}->{'error'}); # Yes, I'm lazy... +# Check if the root directory exists + +abort($config->{'errors'}->{'no_root_dir'}) unless(-d $config->{'fileroot'}); + # Check if we are able to access the root directory abort($config->{'errors'}->{'no_root_access'}) unless(-r $config->{'fileroot'} && -x $config->{'fileroot'}); diff --git a/errors.dat b/errors.dat index ffa9c68..c7a170c 100644 --- a/errors.dat +++ b/errors.dat @@ -12,6 +12,7 @@ mkfile_failed = Could not create file '{FILE}'. mkdir_failed = Could not create directory '{DIR}'. copy_failed = Could not copy '{FILE}' to '{NEW_FILE}'. rename_failed = Could not move/rename '{FILE}' to '{NEW_FILE}'. +no_root_dir = The root directory does not exist or is not a directory. no_root_access = You have not enough permissions to access the root directory. above_root = Accessing files and directories above the virtual root directory is forbidden. create_ar = You aren't allowed to create files and directories above the virtual root directory.