Re: Help: Filemask problem
- From: Amy Lee <openlinuxsource@xxxxxxxxx>
- Date: Sun, 14 Oct 2007 19:55:35 +0800
On Sun, 14 Oct 2007 19:44:35 +0800, Amy Lee wrote:
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 change this part:
my($mode) = stat($file); to
my($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime,
$ctime, $blksize, $blocks) = stat($file);
However, it's useless, what happened?
Thanks,
Amy Lee
.
- Follow-Ups:
- Re: Help: Filemask problem
- From: Martien Verbruggen
- Re: Help: Filemask problem
- References:
- Help: Filemask problem
- From: Amy Lee
- Help: Filemask problem
- Prev by Date: Help: Filemask problem
- Next by Date: Re: Help: Filemask problem
- Previous by thread: Help: Filemask problem
- Next by thread: Re: Help: Filemask problem
- Index(es):
Relevant Pages
|