Androidプログラミング質問スレ Part17
■ このスレッドは過去ログ倉庫に格納されています
0011デフォルトの名無しさん
2012/01/14(土) 12:42:54.34ファイルパスは下記で生成して、
String filepath = Environment.getExternalStorageDirectory().getAbsolutePath() + "testfolder/" + "sample.bin";
で、↓を実行すると、例外「File /mnt/sdcard/testfolder/sample.bin contains a path separator」が発生します。
context.openFileInput( filepath );
なので、openFileInput関数はやめて
File file = new File( filepath );
とやってから
FileInputStream fis=new FileInputStream(file);
とやると、通常に読むことができました。 (filepathは同じ値です。)
そこで質問なのですが
context.openFileInput( filepath );
に渡すfilepathの内容の何がいけなかったのでしょうか? path separatorって 「/」 のことですよね・・?
■ このスレッドは過去ログ倉庫に格納されています