Hey.
I've got a programme that processes the files in a given directory. However, it can only run those files if the programme itself is saved in the same directory.
The error i am experiencing now is that once my programme runs, it also generates a class file which also is processed by the programme (because it's saved in the same directory.)
This causes a jam that that aborts the whole operation.
Could I process the files without saving my java programme in the same folder?
I tried saving it another folder, but the programme wasn't able to access the files, though it could list the file names.
File dir = new File("E:\\Major Project\\FinalLap\\278d.gz.txt");
String path = dir.getAbsolutePath();
int root = path.lastIndexOf("\\");
String howPath = path.substring(0,root+1);
File usePath = new File(howPath);
String[] fileDir = usePath.list();
if(fileDir == null)
{
System.out.println("Directory Does Not Exist");
}
else
{
//etc etc
Thanks again!