File-Tools

 view release on metacpan or  search on metacpan

lib/File/Tools.pm  view on Meta::CPAN



=head2 chmod

Use the built in chmod function.

=cut



=head2 chown

For now use the built in chown function.

It accepts only UID and GID values, but it is easy to retreive them:

 chown $uid, $gid, @files;
 chown getpwnam($user), getgrname($group), @files;

For recursive application use the L<find> function.

 find( sub {chown $uid, $gid, $_}, @dirs);

Windows: See chmod above.

=cut


=head2 cmp

See C<compare>

t/oop.t  view on Meta::CPAN

{
  my $shell = File::Tools->new;
  $shell->copy("old", "new");
}


{
  my $shell = File::Tools->new;
  $shell->things([qw(.)]);  # things are directories, files
  $shell->recoursive(1);
  $shell->chown("username", "groupname");
}


{
  my $shell = File::Tools->new(file => "filename");
  grep /regex/, $shell->cat;
}





( run in 1.936 second using v1.01-cache-2.11-cpan-71847e10f99 )