File: README

package info (click to toggle)
libfile-remove-perl 1.42-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 192 kB
  • ctags: 103
  • sloc: perl: 1,514; makefile: 2
file content (93 lines) | stat: -rw-r--r-- 3,253 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
NAME
    File::Remove - Remove files and directories

SYNOPSIS
        use File::Remove 'remove';

        # removes (without recursion) several files
        remove( '*.c', '*.pl' );

        # removes (with recursion) several directories
        remove( \1, qw{directory1 directory2} ); 

        # removes (with recursion) several files and directories
        remove( \1, qw{file1 file2 directory1 *~} );

        # trashes (with support for undeleting later) several files
        trash( '*~' );

DESCRIPTION
    File::Remove::remove removes files and directories. It acts like
    /bin/rm, for the most part. Although "unlink" can be given a list of
    files, it will not remove directories; this module remedies that. It
    also accepts wildcards, * and ?, as arguments for filenames.

    File::Remove::trash accepts the same arguments as remove, with the
    addition of an optional, infrequently used "other platforms" hashref.

SUBROUTINES
  remove
    Removes files and directories. Directories are removed recursively like
    in rm -rf if the first argument is a reference to a scalar that
    evaluates to true. If the first arguemnt is a reference to a scalar then
    it is used as the value of the recursive flag. By default it's false so
    only pass \1 to it.

    In list context it returns a list of files/directories removed, in
    scalar context it returns the number of files/directories removed. The
    list/number should match what was passed in if everything went well.

  rm
    Just calls remove. It's there for people who get tired of typing remove.

  clear
    The "clear" function is a version of "remove" designed for use in test
    scripts. It takes a list of paths that it will both initially delete
    during the current test run, and then further flag for deletion at
    END-time as a convenience for the next test run.

  trash
    Removes files and directories, with support for undeleting later.
    Accepts an optional "other platforms" hashref, passing the remaining
    arguments to remove.

    Win32
        Requires Win32::FileOp.

        Installation not actually enforced on Win32 yet, since Win32::FileOp
        has badly failing dependencies at time of writing.

    OS X
        Requires Mac::Glue.

    Other platforms
        The first argument to trash() must be a hashref with two keys,
        'rmdir' and 'unlink', each referencing a coderef. The coderefs will
        be called with the filenames that are to be deleted.

SUPPORT
    Bugs should always be submitted via the CPAN bug tracker

    <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove>

    For other issues, contact the maintainer.

AUTHOR
    Adam Kennedy <adamk@cpan.org>

COPYRIGHT
    Some parts copyright 2006 - 2008 Adam Kennedy.

    Taken over by Adam Kennedy <adamk@cpan.org>, to fix the "deep readonly
    files" bug, and do some more cleaning up.

    Some parts copyright 2004 - 2005 Richard Soderberg.

    Taken over by Richard Soderberg <perl@crystalflame.net>, so as to port
    it to File::Spec and add tests.

    Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>.

    This program is free software; you can redistribute and/or modify it
    under the same terms as Perl itself.