File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes diference between mkdirs and mkdirs? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "diference between mkdirs and mkdirs?" Watch "diference between mkdirs and mkdirs?" New topic

diference between mkdirs and mkdirs?

Mauricio Archbold Babroza

Joined: Apr 01, 2009
Posts: 11

what is the diference between make directories, with mkdir and mkdirs???
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60794

It's all explained in the javadoc for

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bitzu Ma

Joined: Feb 18, 2010
Posts: 6
Say you have this:
File f = new File("./folder1/folder2");

f.mkdir() will create only folder2 and only if folder1 already exists on the specified path
f.mkdirs() will create the entire path: if folder1 doesn't exist it will create it and the it will create the subfolder folder2
Mauricio Archbold Babroza

Joined: Apr 01, 2009
Posts: 11
sumit kothalikar
Ranch Hand

Joined: Apr 15, 2010
Posts: 91

Mauricio ,

If you got the solution of your post here.
Please mark your post as

Thanks & Regards
Sumit Kothalikar
wood burning stoves
subject: diference between mkdirs and mkdirs?
Similar Threads
what is tcp??IP??diference between them??
Favorite saying/punchline
addHeader(String, String) vs. setHeader(String, String)
help needed with creating folder