root directory - www or public_html
        Posted  
        
            by Phil Jackson
        on Super User
        
        See other posts from Super User
        
            or by Phil Jackson
        
        
        
        Published on 2010-02-06T07:41:07Z
        Indexed on 
            2010/03/28
            16:03 UTC
        
        
        Read the original article
        Hit count: 304
        
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.
© Super User or respective owner