| Path-Extended documentation | Contained in the Path-Extended distribution. |
Path::Extended::Class::File
Path::Extended::Class::File behaves pretty much like Path::Class::File and can do some extra things. See appropriate pods for details. =head1 COMPATIBLE METHODS
returns a parent Path::Extended::Class::Dir object of the file.
change how to stringify internally and return the file object (instead of the path itself).
returns a volume of the path (if any).
does nothing but returns the object to chain. Path::Extended::Class should always return a canonical path.
does nothing but returns the object to chain. Path::Extended::Class doesn't support foreign path expressions.
returns a new Path::Extended::Class::File object whatever the type is specified.
Kenichi Ishigaki, <ishigaki@cpan.org>
Copyright (C) 2009 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| Path-Extended documentation | Contained in the Path-Extended distribution. |
package Path::Extended::Class::File; use strict; use warnings; use base qw( Path::Extended::File ); sub _initialize { my ($self, @args) = @_; my $file = File::Spec->catfile( @args ); $self->{path} = $self->_unixify( File::Spec->rel2abs($file) ); $self->{is_dir} = 0; $self->{_compat} = 1; $self->{_absolute} = File::Spec->file_name_is_absolute( $file ); $self; } sub new_foreign { my ($class, $type, @args) = @_; $class->new(@args); } sub absolute { my $self = shift; $self->{_base} = undef; $self; } sub relative { my $self = shift; my $base = @_ % 2 ? shift : undef; my %options = @_; $self->{_base} = $base || $options{$base} || File::Spec->curdir; $self; } sub dir { shift->parent } sub volume { shift->parent->volume } sub cleanup { shift } # is always clean sub as_foreign { shift } # does nothing 1; __END__