home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_6c2dd604ba1074e1e7c87f9959d0b056
< prev
next >
Wrap
Text File
|
2000-03-23
|
4KB
|
119 lines
<HTML>
<HEAD>
<TITLE>File::Path - create or remove directory trees</TITLE>
<LINK REL="stylesheet" HREF="../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> File::Path - create or remove directory trees</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#authors">AUTHORS</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>File::Path - create or remove directory trees</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use File::Path;</PRE>
<PRE>
mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>The <CODE>mkpath</CODE> function provides a convenient way to create directories, even
if your <A HREF="../../lib/Pod/perlfunc.html#item_mkdir"><CODE>mkdir</CODE></A> kernel call won't create more than one level of directory at
a time. <CODE>mkpath</CODE> takes three arguments:</P>
<UL>
<LI>
the name of the path to create, or a reference
to a list of paths to create,
<P></P>
<LI>
a boolean value, which if TRUE will cause <CODE>mkpath</CODE>
to print the name of each directory as it is created
(defaults to FALSE), and
<P></P>
<LI>
the numeric mode to use when creating the directories
(defaults to 0777)
<P></P></UL>
<P>It returns a list of all directories (including intermediates, determined
using the Unix '/' separator) created.</P>
<P>Similarly, the <CODE>rmtree</CODE> function provides a convenient way to delete a
subtree from the directory structure, much like the Unix command <CODE>rm -r</CODE>.
<CODE>rmtree</CODE> takes three arguments:</P>
<UL>
<LI>
the root of the subtree to delete, or a reference to
a list of roots. All of the files and directories
below each root, as well as the roots themselves,
will be deleted.
<P></P>
<LI>
a boolean value, which if TRUE will cause <CODE>rmtree</CODE> to
print a message each time it examines a file, giving the
name of the file, and indicating whether it's using <A HREF="../../lib/Pod/perlfunc.html#item_rmdir"><CODE>rmdir</CODE></A>
or <A HREF="../../lib/Pod/perlfunc.html#item_unlink"><CODE>unlink</CODE></A> to remove it, or that it's skipping it.
(defaults to FALSE)
<P></P>
<LI>
a boolean value, which if TRUE will cause <CODE>rmtree</CODE> to
skip any files to which you do not have delete access
(if running under VMS) or write access (if running
under another OS). This will change in the future when
a criterion for 'delete permission' under OSs other
than VMS is settled. (defaults to FALSE)
<P></P></UL>
<P>It returns the number of files successfully deleted. Symlinks are
simply deleted and not followed.</P>
<P><STRONG>NOTE:</STRONG> If the third parameter is not TRUE, <CODE>rmtree</CODE> is <STRONG>unsecure</STRONG>
in the face of failure or interruption. Files and directories which
were not deleted may be left with permissions reset to allow world
read and write access. Note also that the occurrence of errors in
rmtree can be determined <EM>only</EM> by trapping diagnostic messages
using <CODE>$SIG{__WARN__}</CODE>; it is not apparent from the return value.
Therefore, you must be extremely careful about using <CODE>rmtree($foo,$bar,0</CODE>
in situations where security is an issue.</P>
<P>
<HR>
<H1><A NAME="authors">AUTHORS</A></H1>
<P>Tim Bunce <<EM><A HREF="mailto:Tim.Bunce@ig.co.uk">Tim.Bunce@ig.co.uk</A></EM>> and
Charles Bailey <<EM><A HREF="mailto:bailey@newman.upenn.edu">bailey@newman.upenn.edu</A></EM>></P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> File::Path - create or remove directory trees</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>