Parrot::IO::Path - Path
Parrot::IO::Path is an abstract superclass providing common path logic for Parrot::IO::File and Parrot::IO::Directory.
Parrot::IO::Path
Parrot::IO::File
Parrot::IO::Directory
Instances created with new() are cached so that there is only one unique instance for each path.
new()
new($path)
Returns the instance for $path if it already exists, otherwise it is created and cached. A relative path is made absolute.
$path
create_path()
This is called from new() to create the parent path if necessary. Subclasses should reimplement this method to complete the task.
path()
Returns the actual path.
name()
Returns the name part of the path.
name_without_suffix()
This will give you the name minus any .xyz suffix.
suffix()
Use this to get the name's .xyz suffix or extension. If there is no suffix then the empty string is returned.
has_suffix()
Finds out whether the name has a .xyz suffix.
has_suffix($suffix)
Finds out whether the name suffix is $suffix.
$suffix
Note that if a name has no suffix and if $suffix is the empty string then this method will return true.
parent_path()
Returns the path of the containing directory.
stat()
Returns the File::stat object. Used by subclasses to get information about the path.
File::stat
delete()
Removes the instance from the cache, and undefines it.
To install Ruby, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ruby
CPAN shell
perl -MCPAN -e shell install Ruby
For more information on module installation, please visit the detailed CPAN module installation guide.