java - .getAbsoultePath prints the ProjectPath instead of SystemPath? -


there little problem file.getabsolutepath() method , tried f.getcanonicalpath(); method.

instead of

c:/documents , settings

it prints

c:\users\me\documents\netbeansprojects\filec\documents , settings

could maybe explain how should changed ?

thank you

    f = new file(c://);     fs = f.list();      for(string fsv : fs) {      f = new file(fsv);      string ap = f.getabsolutepath();      system.out.println(ap); 

in fs names of files in c: , if give file name file object add name current working directory. change code that:

    file f = new file("c:/");     file[] fs = f.listfiles();     (file fsv : fs) {         string ap = fsv.getabsolutepath();         system.out.println(ap);     } 

i hope helps.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -