root directory - www or public_html
- by Phil Jackson
Is the root directory where all files are kept (directly from accessing from FTP) always "www" or "public_html" depending on what OS? Or is it possible to rename this folder? And if so, what would be unique about this folder to be able to identify it? i.e. currently I just wrote this;
my $root;
my $ftp = Net::FTP->new($DB_ftpserver, Debug => 0)
or die "Cannot connect to some.host.name: $@";
$ftp->login($DB_ftpuser, $DB_ftppass) or die "Cannot login ", $ftp->message;
my @list = $ftp->dir;
if( scalar @list != 0 ) {
foreach( @list ){
if( $_ =~ m/www$/g ){
$root = "www";
last;
}elsif( $_ =~ m/public_html$/g ){
$root = "public_html";
last;
}
}
}
but would not work if it has a different name.
Any help much appreciated.