First, I did read this post about this exception carefully, but the answers cannot explain my case. I don't think permission is an issue here.
The code:
Serializer serializer = new Persister();
File fFoo= new File(context.getFilesDir(), "foo.xml");
serializer.write(fooObject, fFoo);
serializer.write() throws the following exception once in a while:
Stack trace: java.io.FileNotFoundException: /data/data/net.foo.appfoo/files/foo.xml: open failed: EROFS (Read-only file system)
at libcore.io.IoBridge.open(IoBridge.java:460)
at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
at java.io.FileOutputStream.<init>(FileOutputStream.java:73)
at org.simpleframework.xml.core.Persister.write(SourceFile:1198)
Could anyone point to a possible scenario for this to happen?