NAME

Parrot::IO::File - File

SYNOPSIS

use Parrot::IO::File;

DESCRIPTION

Use this to query and manipulate files and their contents.

Class Methods

tmp_file($path)

Returns the file for $path relative to the default temporary directory.

new($path)

Returns the instance for $path.

Instance Methods

create_path()

This is called from new() to create the path if necessary.

parent($path)

Returns the file's parent directory.

read()

This reads the contents of the file and returns it as an array or string depending on the context in which the method is called.

$contents = $file->read;
@lines = $file->read;
write(@lines)

Writes the specified lines to the file.

append(@lines)

Writes the specified lines to the file.

is_executable()

This tells you whether the file is executable.

modified_since($time)

Use this to find out whether the file has been modified since the specified time. $time is a number of non-leap seconds since the epoch.

svn_id()

Returns the svn $Id string.

has_svn_id()

Returns whether the file has a svn $Id string.

svn_version()

Returns the svn version number of the file.

is_hidden()

Returns whether the file is "hidden", i.e. it's name starts with a dot.

is_generated()

Returns whether the file is generated.

delete()

Deletes the file, removes the instance from the cache, and undefines it.

Raises an exception if the delete fails.

SEE ALSO

Parrot::IO::Directory
Parrot::IO::Path