U
Ulf Meinhardt
I would like to check in a Java program if a certain directory exists.
The following does NOT work:
String fn = new String("C:\foobarnotexisting");
File root = new File(fn);
System.out.println("res=" + root.exists());
if (!root.exists()) {
System.out.println("not existing"); }
After compiling there is NO output.
Why?
How else can I check the existence?
Ulf
The following does NOT work:
String fn = new String("C:\foobarnotexisting");
File root = new File(fn);
System.out.println("res=" + root.exists());
if (!root.exists()) {
System.out.println("not existing"); }
After compiling there is NO output.
Why?
How else can I check the existence?
Ulf