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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s