Hi friends
I want to know how to create a folder in java using files concept.
Can any one send me the code to create a folder in our system using files concept.
Thanks in advance
Printable View
Hi friends
I want to know how to create a folder in java using files concept.
Can any one send me the code to create a folder in our system using files concept.
Thanks in advance
In the Java.io.file package you have a mkdir method which is used to create a directory. I dont remember how this is exactly used but iam sure that it can be created with this method.
Hey radhika here is the sample code. i think this should work for you. Am not sure as i have not tested as te system from which am accessing the forum from the cyber cafe. please let me know if any chnages are made in this to compile.
File f = new File("C:\TEST");
try{
if(f.mkDir())
System.out.println("Directory Created");
else
System.out.println("Directory is not created");
}catch(Exception e){
e.printStacktrace();
}
I am trying Socket programming. Can I get code to get name & type of transferred file from client to serverside....
how do you delet the folder from the program ?
try this code
File f1 = new File(file);
boolean success = f1.delete();
Guys, please use code tags when you are posting code segments in the forum. Unformatted codes are really hard to read. :)
fortunately, the above code is still easy to read... :D: