Hi, I a piece of codes which is tring to read a directory on a Linux platform as following. The purpose is to check whether a particular directory is writable:
#!/usr/bin/perl
use File::Copy;
$ftp_path = "/image_1";
$result = "";
$result = system("ls -dl $ftp_path |cut -c1-10");
if($result eq 'drwxrwxrwx'){
print ("$ftp_path is writable\n");
}
else{
print ("$ftp_path is not writable\n");
}
However, this code will print out the mode of the directory, for example "drwxrwxrwx", on the screen without sending this string to the variable.
Thanks for taking your precious time to answer my question!
Green Apple
[/email]
#!/usr/bin/perl
use File::Copy;
$ftp_path = "/image_1";
$result = "";
$result = system("ls -dl $ftp_path |cut -c1-10");
if($result eq 'drwxrwxrwx'){
print ("$ftp_path is writable\n");
}
else{
print ("$ftp_path is not writable\n");
}
However, this code will print out the mode of the directory, for example "drwxrwxrwx", on the screen without sending this string to the variable.
Thanks for taking your precious time to answer my question!

Green Apple
[/email]