#!/opt/perl/bin/perl use File::Find; find \&wanted, "/"; sub wanted { my $dev; # the file system device number my $ino; # inode number my $mode; # mode of file my $nlink; # counts number of links to file my $uid; # the ID of the file's owner my $gid; # the group ID of the file's owner my $rdev; # the device identifier my $size; # file size in bytes my $atime; # last access time my $mtime; # last modification time my $ctime; # last change of the mode my $blksize; # block size of file my $blocks; # number of blocks in a file #Right below here your telling lstat to retrieve all this info on each and every file/directory. Each and every file/directory is written to $_. (($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = lstat($_)); print "Files UID = $uid\n"; print "Files GID = $gid\n"; print "Files ctime = $ctime\n"; }
print "$_ $mode $size $mtime\n";
To print out file name and path I use :
print $File::Find::name . "\n";
You need to create an account or log in to post comments to this site.