Click to See Complete Forum and Search --> : How do I make a directory?
Mark Sreeves
Aug 1st, 2000, 04:57 AM
How do I make a directory using Java?
secondly, how do I test if a directory exists already?
Mark Sreeves
Aug 1st, 2000, 06:00 AM
Ok,OK!
you can all stop looking now! I've just found it!
Sophtware
Aug 23rd, 2000, 02:36 AM
What is the code? id like to see it please.
Mark Sreeves
Aug 23rd, 2000, 03:04 AM
This is for java executables
import java.io.*;
//
// Mark Sreeves July 2000
//
// makes a directory
//
public class CreateDir{
public static void main(String[] args) throws IOException
{
if (args.length != 1){
System.out.println("usage: java CreateDir [Dir name]");
}else{
File TargetFile;
TargetFile = new File(args[0].toString());
if (!TargetFile.exists()){
TargetFile.mkdir();//if not create it
}
};
};
}
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.