Dec 18, 2003 #1 mooniron Programmer Dec 15, 2002 26 TR Could anyone tell me how to create directory in Perl. Thanks
Dec 18, 2003 #2 PaulTEG Technical User Sep 26, 2002 4,469 IE mkdir "/path/to/directory"; HTH --Paul Upvote 0 Downvote
Dec 18, 2003 #4 h011ywood Programmer Dec 1, 2003 55 US It's probably safer to do this: use File:ath; mkpath($path); In the case that you are trying to create a directory, where a previous directory doesn't exist. i.e. You want to create: /documents/tests/drivers/linux/kernel and directory /documents/tests/drivers doesn't exist....it wont be able to create the full directory using mkdir. mkpath() will create all the previous non-created directories supplied in the path variable. Upvote 0 Downvote
It's probably safer to do this: use File:ath; mkpath($path); In the case that you are trying to create a directory, where a previous directory doesn't exist. i.e. You want to create: /documents/tests/drivers/linux/kernel and directory /documents/tests/drivers doesn't exist....it wont be able to create the full directory using mkdir. mkpath() will create all the previous non-created directories supplied in the path variable.
Dec 30, 2004 #5 BryanY MIS Aug 18, 2001 54 US What about the situation where the exact path already exists, so it shouldn't create anything? How would mkpath handle that? Basically I'm looking to for the same functionality as mkdir -p in a shell script. Upvote 0 Downvote
What about the situation where the exact path already exists, so it shouldn't create anything? How would mkpath handle that? Basically I'm looking to for the same functionality as mkdir -p in a shell script.