Matt S Trout > Rakudo-Star > Parrot::IO::File

Download:
Rakudo-Star-2012.08_001.tar.gz

Dependencies

Annotate this POD

Source  

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.

is_hidden()

Returns whether the file is "hidden", i.e. its 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
syntax highlighting: