Dec 18, 2003 #1 mooniron Programmer Joined Dec 15, 2002 Messages 26 Location TR Could anyone tell me how to create directory in Perl. Thanks
Dec 18, 2003 #2 PaulTEG Technical User Joined Sep 26, 2002 Messages 4,469 Location IE mkdir "/path/to/directory"; HTH --Paul Upvote 0 Downvote
Dec 18, 2003 Thread starter #3 mooniron Programmer Joined Dec 15, 2002 Messages 26 Location TR Thanks Upvote 0 Downvote
Dec 18, 2003 #4 h011ywood Programmer Joined Dec 1, 2003 Messages 55 Location 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 Joined Aug 18, 2001 Messages 54 Location 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.