A
Amy Lee
Hello,
I write a perl script to show the file mask like -rwxr-xr-x is 0755, but
when I run my script, it shows 835 in this mode. I don't know why.
There's my code:
#!/usr/bin/perl -w
if (@ARGV == 0)
{
die "Usage: filemask.pl <filename(s)>\n";
}
if (@ARGV != 0)
{
foreach $file (@ARGV)
{
unless (-e $file)
{
print "***Error: $file dose not exist.\n";
next;
}
unless (-r $file)
{
print "***Error: Cannot read $file.\n";
next;
}
my($mode) = stat($file);
print "$file ==> $mode\n";
}
}
Could you tell me how to solve this?
Thank you very much~
Regards,
Amy Lee
I write a perl script to show the file mask like -rwxr-xr-x is 0755, but
when I run my script, it shows 835 in this mode. I don't know why.
There's my code:
#!/usr/bin/perl -w
if (@ARGV == 0)
{
die "Usage: filemask.pl <filename(s)>\n";
}
if (@ARGV != 0)
{
foreach $file (@ARGV)
{
unless (-e $file)
{
print "***Error: $file dose not exist.\n";
next;
}
unless (-r $file)
{
print "***Error: Cannot read $file.\n";
next;
}
my($mode) = stat($file);
print "$file ==> $mode\n";
}
}
Could you tell me how to solve this?
Thank you very much~
Regards,
Amy Lee