FileNotFoundException avec File et FileInputStream
Bien l'bonsoir par ici,
Quelqu'un pourrait-il m'expliquer ce comportement étrange ?
Lorsque j'exécute le code ci-après :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| try{
File f = new File ("C:\\bidon\\test.txt");
FileInputStream fis = new FileInputStream(f);
Log.i("test", fis.toString());
}catch (FileNotFoundException e){
e.printStackTrace();
} |
j'obtiens l'Exception suivante :
Code:
1 2 3 4 5
| 05-14 22:48:59.255: W/System.err(1157): java.io.FileNotFoundException: /C:\bidon\test.txt
05-14 22:48:59.255: W/System.err(1157): at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:244)
05-14 22:48:59.276: W/System.err(1157): at java.io.FileInputStream.<init>(FileInputStream.java:77)
05-14 22:48:59.285: W/System.err(1157): at com.app.jBidouille.DataChannel.run(DataChannel.java:66)
05-14 22:48:59.301: W/System.err(1157): at java.lang.Thread.run(Thread.java:1096) |
Pourtant J'ai vérifié :
- l'orthographe du chemin et du fichier
- l’existence du fichier
D'avance merci pour vos lumières.