help in search for a file...
hai...
i need to search my machine for a particular file and as a result get the path of that particular file...
tere is a recursive function for this.but the problem with this code is that it just searches a single folder and not all the folders of the drive. my code is
public String findFile(File f, String target)
{
if (f.getName().equals(target))
{
return f.getPath();
}
File[] list = f.listFiles();
for (short i = 0; i < list.length; i++)
{
if (list[i].isDirectory())
{
return findFile(list[i], target);
}
else
if (list[i].getName().equals(target))
return list[i].getPath();
}
return" Not found";
}
in this target is the file to be searched and the other parameter is the drive where the file is to searched...
plz help me...

