| File::Fu::File - a filename object |
File::Fu::File - a filename object
my $file = File::Fu::File->new($path);
my $file = File::Fu::File->new(@path);
my $file = File::Fu::File->new_direct( dir => $dir_obj, file => $name );
Return the corresponding dir class for this file object.
my $dc = $class->dir_class;
Returns a new object representing only the file part of the name.
my $obj = $file->basename;
my $string = $file->stringify;
$newfile = $file->append('.gz');
$file .= '.gz';
$file->map(sub {...});
$file &= sub {...};
Get an absolute name
Open the file with $mode ('<', 'r', '>', 'w', etc) -- see the IO::File manpage.
my $fh = $file->open($mode, $permissions);
Throws an error if anything goes wrong or if the resulting filehandle happens to be a directory.
my $link = $file->link($name);
my $link = $file->symlink($linkname);
Note that symlinks are relative to where they live.
my $dir = File::Fu->dir("foo"); my $file = $dir+'file'; # $file->symlink($dir+'link'); is a broken link my $link = $file->basename->symlink($dir+'link');
Calls the builtin rename() on the $file and returns a new object with
that name.
$file = $file->rename($newname);
$file->unlink;
my $to = $file->readlink;
Eric Wilhelm @ <ewilhelm at cpan dot org>
If you found this module on CPAN, please report any bugs or feature requests through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
If you pulled this development version from my /svn/, please contact me directly.
Copyright (C) 2008 Eric L. Wilhelm, All Rights Reserved.
Absolutely, positively NO WARRANTY, neither express or implied, is offered with this software. You use this software at your own risk. In case of loss, no person or entity owes you anything whatsoever. You have been warned.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| File::Fu::File - a filename object |