ppmoore
03-30-2009, 01:43 PM
Hello again.
Another newbie question for the long suffering experts here...
I'm running the Android emulator with eclipse under WinXP.
I have the following code:
File filePath = new File( "file.txt");
String fileName = filePath.getName();
try {
BufferedReader input = new BufferedReader(new FileReader(fileName));
}
catch( FileNotFoundException e1 ) {
System.out.println("Error: File not found");
}This throws the exception FileNotFoundException.
Under Linux this would be easy, but how to correctly specify file paths under Windows? I've copied the file to all directories:
the windows C: root directory
the eclipse project root directory
the eclipse project src directory
the eclipse project bin directory
and it cannot find the file. Can anyone help?
Thanks,
Paul
Another newbie question for the long suffering experts here...
I'm running the Android emulator with eclipse under WinXP.
I have the following code:
File filePath = new File( "file.txt");
String fileName = filePath.getName();
try {
BufferedReader input = new BufferedReader(new FileReader(fileName));
}
catch( FileNotFoundException e1 ) {
System.out.println("Error: File not found");
}This throws the exception FileNotFoundException.
Under Linux this would be easy, but how to correctly specify file paths under Windows? I've copied the file to all directories:
the windows C: root directory
the eclipse project root directory
the eclipse project src directory
the eclipse project bin directory
and it cannot find the file. Can anyone help?
Thanks,
Paul