Catmandu-Fix-File
view release on metacpan or search on metacpan
lib/Catmandu/Fix/Condition/file_test.pm view on Meta::CPAN
=over
=item path
=item tests
List of file tests, all in one string.
Possible file tests (taken from <http://perldoc.perl.org/functions/-X.html>):
R File is readable by real uid/gid.
W File is writable by real uid/gid.
X File is executable by real uid/gid.
O File is owned by real uid.
e File exists.
z File has zero size (is empty).
s File has nonzero size (returns size in bytes).
f File is a plain file.
lib/Catmandu/Fix/Condition/file_test.pm view on Meta::CPAN
S File is a socket.
b File is a block special file.
c File is a character special file.
t Filehandle is opened to a tty.
u File has setuid bit set.
g File has setgid bit set.
k File has sticky bit set.
T File is an ASCII or UTF-8 text file (heuristic guess).
B File is a "binary" file (opposite of -T).
=back
=head1 AUTHOR
lib/Catmandu/Fix/file_stat.pm view on Meta::CPAN
my ${temp_var} = [stat(${var})];
if( scalar(\@{${temp_var}}) ){
${var} = {
dev => ${temp_var}->[0],
ino => ${temp_var}->[1],
mode => ${temp_var}->[2],
nlink => ${temp_var}->[3],
uid => ${temp_var}->[4],
gid => ${temp_var}->[5],
rdev => ${temp_var}->[6],
size => ${temp_var}->[7],
atime => ${temp_var}->[8],
mtime => ${temp_var}->[9],
ctime => ${temp_var}->[10],
blksize => ${temp_var}->[11],
blocks => ${temp_var}->[12]
};
}
lib/Catmandu/Fix/file_stat.pm view on Meta::CPAN
}
=head1 NAME
Catmandu::Fix::file_stat - get file status information
=head1 SYNOPSIS
add_field('path','/home/njfranck/test.txt')
#'path' is now a hash containing keys like mode, uid, gid, size, atime ..
file_stat('path')
=head1 AUTHOR
Nicolas Franck, C<< <nicolas.franck at ugent.be> >>
=head1 SEE ALSO
L<Catmandu::Fix>
( run in 2.924 seconds using v1.01-cache-2.11-cpan-5735350b133 )