PDA

View Full Version : Make a new Folder with Java




Eraserhead
Apr 3, 2006, 08:47 AM
Hey

I wondered how you created a new folder or directory with java, when in xcode with the code

File f=new File("/test");
if(f.exists()==false){
f.mkdirs();}
it produces two cannot find symbol errors on the first line. Why is this? how do I create a directory with Java on Mac OS X?

Thanks

Matthew



robbieduncan
Apr 3, 2006, 09:02 AM
Java 101: Have you imported java.io.File? If not then you will not be able to use it like that (you could replace File with java.io.File)...

Eraserhead
Apr 3, 2006, 09:14 AM
:rolleyes: Thanks, I knew it'd be something like that.:o