MAN page from RedHat Other perl-5.004-0.1.i386.rpm
File::Path
Section: Perl Programmers Reference Guide (3)
Updated: perl 5.004, patch 04
Index NAME
File::Path - create or remove a series of directories
SYNOPSIS
use File::Pathmkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
DESCRIPTION
The
mkpath function provides a convenient way to create directories, evenif your
mkdir kernel call won't create more than one level of directory ata time.
mkpath takes three arguments:
- •
- the name of the path to create, or a referenceto a list of paths to create,
- •
- a boolean value, which if TRUE will cause mkpathto print the name of each directory as it is created(defaults to FALSE), and
- •
- the numeric mode to use when creating the directories(defaults to 0777)
It returns a list of all directories (including intermediates, determinedusing the Unix `/' separator) created.
Similarly, the rmtree function provides a convenient way to delete asubtree from the directory structure, much like the Unix command rm -r.rmtree takes three arguments:
- •
- the root of the subtree to delete, or a reference toa list of roots. All of the files and directoriesbelow each root, as well as the roots themselves,will be deleted.
- •
- a boolean value, which if TRUE will cause rmtree toprint a message each time it examines a file, giving thename of the file, and indicating whether it's using rmdiror unlink to remove it, or that it's skipping it.(defaults to FALSE)
- •
- a boolean value, which if TRUE will cause rmtree toskip any files to which you do not have delete access(if running under VMS) or write access (if runningunder another OS). This will change in the future whena criterion for `delete permission' under OSs otherthan VMS is settled. (defaults to FALSE)
It returns the number of files successfully deleted. Symlinks aretreated as ordinary files.
NOTE: If the third parameter is not TRUE, rmtree is unsecurein the face of failure or interruption. Files and directories whichwere not deleted may be left with permissions reset to allow worldread and write access. Note also that the occurrence of errors inrmtree can be determined only by trapping diagnostic messagesusing $SIG{__WARN__}; it is not apparent from the return value.Therefore, you must be extremely careful about using rmtree($foo,$bar,0in situations where security is an issue.
AUTHORS
Tim Bunce <
Tim.BunceAATTig.co.uk> andCharles Bailey <
baileyAATTgenetics.upenn.edu>
REVISION
Current
$VERSION is 1.04.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- AUTHORS
- REVISION
This document was created byman2html,using the manual pages.