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

NAME

PFT::Content::File - On disk content file.

SYNOPSIS

    use PFT::Content::File;

    my $f1 = PFT::Content::File->new({
        tree => $tree,
        path => $path,
        name => $name,  # optional, defaults to basename($path)
    });

DESCRIPTION

This class describes a content file on disk.

Properties

Besides the properties following in this section, more are inherited from PFT::Content::Base.

path

Absolute path of the file on the filesystem.

encpath

Absolute path, encoded with locale

filename

Base name of the file

mtime

Last modification time according to the filesystem.

open

Open a file descriptor for the file:

    $f->open        # Read file descriptor
    $f->open($mode) # Open with r|w|a mode

This method does automatic error checking (confessing on error).

touch

Change modification time on the filesytem to current timestamp.

exists

Verify if the file exists

empty

Check if the file is empty

rename_as

Move the file in the filesystem, update internal data.