Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
make directories
Bhargav Coca
I am TS6.5 on win2000. I am trying to do is create diesctories based on my DCR path.
I am getting my DCR path and the generated xml path too. I need to pass this xml path and let a small function to create directory which my path is missing.
please help
Thank you
Find more posts tagged with
Comments
JonathonG
use File:
ath;
mkpath($pathToCreate)
Jonathon
Interwoven Developer
Allstate, Inc.
Bhargav Coca
i have downloaded that module and tried it didn't work for me.
Thanks
Adam Stoller
To take this a step further - especially for Unix (though I believe it works well for Windows too):
use File:
ath;
{
my $umask = 0;
# temporarilly remove umask
my
@newdirs
= mkpath($dir);
# or ... mkpath(\
@dirlist)
;
umask $umask;
# reset umask back to original value
}
mkpath()
takes 1 required paramater (
a path, or reference to array of paths
), and 2 optional paramaters (
boolean to be verbose - default is FALSE [0]; bitmask to use - default is 0777
). The last parameter (defaulted or otherwise) is why you want to temporarilly remove the umask so that you don't have to worry about the current umask being or'd with the default or otherwise specified umask and ending up with something you don't want (
it may not be necessary, but IMO it's better to be clear and safe about it
).
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
JonathonG
What exactly didn't work? What were the results of using it? Did you try ghoti's additional suggestion?
Jonathon
Interwoven Developer
Allstate, Inc.
Bhargav Coca
I am passing the relative path to the $dir, I hope i am right, but none of the directory is created. I am attaching my perlscript along with this post.
Thank you
JonathonG
mkpath takes a full directory path. I don't think it works with relative paths. Try using a full path instead and see if that works.
Jonathon
Interwoven Developer
Allstate, Inc.
Bhargav Coca
Awesome guys, You are all the best.
Thank you
HAPPY HOLIDAYS