The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

File::Properties::Generic - Perl module representing properties of a generic disk file

SYNOPSIS

  use File::Properties::Generic;

  my $fpg = File::Properties::Generic->new('/path/to/file');
  print $fpg->string . "\n";

ABSTRACT

  File::Properties::Generic is a Perl module representing properties
  of a generic disk file.

DESCRIPTION

  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.
new
  my $fpg = File::Properties::Generic->new('/path/to/file');

Constructs a new File::Properties::Generic object.

path
  print "Canonical path: " . $fpg->path . "\n";

Determine the canonical path of the represented file.

device
  print "Device number: " . $fpg->device . "\n";

Determine the device number of the represented file.

inode
  print "Inode number: " . $fpg->inode . "\n";

Determine the inode number of the represented file.

size
  print "File size: " . $fpg->size . "\n";

Determine the size of the represented file.

mtime
  print "Modification time: " . $fpg->mtime . "\n";

Determine the modification time of the represented file.

mode
  print "File mode: " . $fpg->mode . "\n";

Determine the file mode integer (representing permissions and type) for the represented file.

children
  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.

isreg
  print (($fpg->isreg)?"Is regular file\n":"Not regular file\n");

Determine if the represented file is a regular file.

isdir
  print (($fpg->isdir)?"Is directory\n":"Not directory\n");

Determine if the represented file is a directory.

string
  print $fpg->string . "\n";

Construct a string representing the object data.

SEE ALSO

File::Properties, Cwd, File::stat, Fcntl

AUTHOR

Brendt Wohlberg <wohl@cpan.org>

COPYRIGHT AND LICENSE

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.