java - new FILE doesn't Exist in OS X 10.7 -
i'm trying next getting no file created ( no errors thrown either ) on imac os x 10.7.5
tried different paths , looked @ permissions, can -> $ touch myfile1.txt through console...
if create file console , run code file detected , exists.
file f = new file("/users/myname/documents/myfile1.txt"); not create one...
why doesn't work?
file f = new file("/users/myname/documents/myfile1.txt"); if(f.exists()) { system.out.println(f.getname() + " file exists"); } else { system.out.println(f.getname() + " doesn’t exist"); }
thanks help....
when doing
file f = new file();
only object of type file created. not creating actual file.
the actual file created when use
f.createnewfile() function of class file.
java file-io
No comments:
Post a Comment