Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.io.FileNotFoundException when using RandomAccessFile to create file

I'm encountering a FileNotFoundException when I try to make a file using RandomAccessFile:

RandomAccessFile file = new RandomAccessFile("/test.jpg", "rw");

I don't now how to get around this. It's driving me nuts.

Thanks

like image 941
mlevit Avatar asked Aug 30 '10 03:08

mlevit


1 Answers

Try

RandomAccessFile file = new RandomAccessFile(new File(getFilesDir(), "test.jpg"),
        "rw");
like image 187
Konstantin Burov Avatar answered Oct 29 '22 11:10

Konstantin Burov