stat Perl API

Perl API — stat()

$ls test.pl
test.pl
$cat test.pl
my $result = stat('./test.pl');
print "$result n";
$perl test.pl
1
$

Perl Explanation

Returns a 13-element list giving the status info for a file, either
the file opened  via FILEHANDLE or DIRHANDLE, or  named by EXPR. If
EXPR is omitted,  it stats $_ (not _ !). Returns  the empty list if
stat fails.

computing Theory Drop
stat() is a Unix system call  that returns useful data about a file
inode. The  semantics of stat() vary between  operating systems. As
an example, the Unix command  ls uses it to retrieve information on
(among many others):

source : http://en.wikipedia.org/wiki/Stat_(system_call)

Leave a comment

Your email address will not be published. Required fields are marked *