Hi all, I am devloping one application in which I want to know the path of particular file, suppose i want to know the path of Apache.exe, where this file is saved. Thanks Puneet
hi, you can first search the "default" locations where this file could be, if this fails search the whole disk or ask user to point to the file. i dont see another way to do this, i might be wrong ? is this enough or do you need more infos on how to handle files ? karl
Hi Karl, thanks for your response, I have solved this problem. I used File class for this, firstly I saw number of drives in the system by listRoots(), than see all the files in folders and sub-folders in these drives and comapre these files with name of file. Than I got absolute path of this file. Once again Thanks Puneet
here is the code that can help u out ..... static void Tri(File file) { if(!file.isDirectory()) { return; } File fi[]=file.listFiles(); for(int i=0; i<fi.length; i++)> { list.add(fi[i].getPath()); Tri(fi[i]); } }
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
a bit of art, as a gift, the permaculture playing cards