Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Eraserhead

macrumors G4
Original poster
Nov 3, 2005
10,434
12,250
UK
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

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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)...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.