NAME

Dpchrist::File::LimitPath - limit path lengths


DESCRIPTION

SUBROUTINES

limit_path

    limit_path LIST

Checks path length of each item in LIST and shortens file names to keep path length less than or equal to a prescribed limit (default 220). If a list item is a directory, processes contained files recursively. Returns true (1).

Prints the names of shortened files. Use the "-quiet" option to suppress.

Options may be set via %Dpchrist::File::LimitPath::opt:

-delete => [0|1]

Delete files that are too long but can't be shortened. Delete files that, if renamed, would collide with other files (previously existing or another renamed file).

-dry_run => [0|1]

Check files, but don't rename any.

-limit => LIMIT

Maximum path length in characters. Must be between the longest LIST item length and 32767 (inclusive).

-quiet => [0|1]

Only output error messages.

Calls Carp::confess() on errors, including:

EXPORT

None by default.

All of the subroutines may be imported by using the ':all' tag:

    use Dpchrist::File::LimitPath    qw( :all );

See 'perldoc Export' for everything in between.

                    
=head1 INSTALLATION
    perl Makefile.PL
    make
    make test
    make install


DEPENDENCIES

    Perl 5.10.0
    Dpchrist::Debug
    Dpchrist::Module
    File::Slurp


SEE ALSO

    limitpath(1)


AUTHOR

David Paul Christensen dpchrist@holgerdanske.com


COPYRIGHT AND LICENSE

Copyright 2010 by David Paul Chirstensen dpchrist@holgerdanske.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.