Thursday, December 3, 2009

Using mkpath in perl

mkpath (path, bool, perm)

Creates a directory path and returns a list of all directories created. It requires File::Path module
It takes the following arguments:
path: Name of the path or reference to a list of paths to create.
bool : Boolean. If true, mkpath prints the name of each directory as it is created. Default is false.
perm : Numeric mode indicating the permissions to use when creating the directories. Default is 0777.
 ======================================
$path = "C:\\test" ;
mkpath($path); # it will create the directories required.
print mkpath($path, 1); # it will also print all the directories made during mkpath.

No comments:

Post a Comment