File::Properties::Generic - Perl module representing properties of a generic disk file
use File::Properties::Generic; my $fpg = File::Properties::Generic->new('/path/to/file'); print $fpg->string . "\n";
File::Properties::Generic is a Perl module representing properties of a generic disk file.
File::Properties::Generic is a Perl module representing properties of a generic disk file. On architectures on which stat is fully supported, indicated by the value of flag $File::Properties::Generic::FullStatSupport, these properties include device and inode numbers. This flag is currently only set true for Unix operating systems (since others were not available for testing); on other platforms on which stat does indeed provide meaningful device and inode numbers, this value can be forced by including a line $File::Properties::Generic::FullStatSupport = 1; before initialisation of any File::Properties objects.
my $fpg = File::Properties::Generic->new('/path/to/file');
Constructs a new File::Properties::Generic object.
print "Canonical path: " . $fpg->path . "\n";
Determine the canonical path of the represented file.
print "Device number: " . $fpg->device . "\n";
Determine the device number of the represented file.
print "Inode number: " . $fpg->inode . "\n";
Determine the inode number of the represented file.
print "File size: " . $fpg->size . "\n";
Determine the size of the represented file.
print "Modification time: " . $fpg->mtime . "\n";
Determine the modification time of the represented file.
print "File mode: " . $fpg->mode . "\n";
Determine the file mode integer (representing permissions and type) for the represented file.
my $chsh = $fpg->children;
If the represented file is a directory, return a hash mapping file names within that directory to corresponding File::Properties::Generic object references.
print (($fpg->isreg)?"Is regular file\n":"Not regular file\n");
Determine if the represented file is a regular file.
print (($fpg->isdir)?"Is directory\n":"Not directory\n");
Determine if the represented file is a directory.
print $fpg->string . "\n";
Construct a string representing the object data.
File::Properties, Cwd, File::stat, Fcntl
Brendt Wohlberg <wohl@cpan.org>
Copyright (C) 2010,2011 by Brendt Wohlberg
This library is available under the terms of the GNU General Public License (GPL), described in the LICENSE file included in this distribution.
To install File::Properties, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Properties
CPAN shell
perl -MCPAN -e shell install File::Properties
For more information on module installation, please visit the detailed CPAN module installation guide.