Hi,
how can i display the file in the current directory in the UNix to get displayed through Perl script. i m using File:: Find whcich gives you anem of the file but how to get the attribute of the file to be displayed
Nilesh
yes u are right,
but it doesnt supported in all file system.
not all unix supports that.
what i want is to get all filename as key and permissions as value into the hash.
thanks
Have a look at:
File::stat - by-name interface to Perl's built-in stat() functions
SUPPORTED PLATFORMS
Linux
Solaris
Windows
In the perl documentation. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
to make a hash like you want, you'll do something like:[tt]
my %files = ();
foreach (@the_files_you_found_with_File_Find) {
$files{$_} = (stat($_))[4];
}[/tt]
'4' is NOT the number you want, i just put it in for the fun of it.
Does stat work on your system? "If you think you're too small to make a difference, try spending a night in a closed tent with a mosquito."
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.