我对我的应用程序要做的是下载一些文件并写入/mnt/local/。
这是我尝试的:
String baseDir = Environment.getRootDirectory().getAbsolutePath()+"/mnt/local/mydir" //mydir exists.
FileOutputStream fOut = new FileOutputStream(baseDir);
我得到的是:
11-08 18:40:29.799: W/System.err(26464): java.io.FileNotFoundException: /system/mnt/local/htdocs: open failed: ENOENT (No such file or directory)
11-08 18:40:29.800: W/System.err(26464): at libcore.io.IoBridge.open(IoBridge.java:409)
11-08 18:40:29.801: W/System.err(26464): at java.io.FileOutputStream.<init>(FileOutputStream.java:88)
11-08 18:40:29.802: W/System.err(26464): at java.io.FileOutputStream.<init>(FileOutputStream.java:128)
11-08 18:40:29.803: W/System.err(26464): at java.io.FileOutputStream.<init>(FileOutputStream.java:117)
11-08 18:40:29.803: W/System.err(26464): at support.Support.downloadFile(Support.java:45)
11-08 18:40:29.804: W/System.err(26464): at task.OfflineUpdate.updateFromArchive(OfflineUpdate.java:84)
11-08 18:40:29.805: W/System.err(26464): at task.OfflineUpdate.update(OfflineUpdate.java:77)
11-08 18:40:29.805: W/System.err(26464): at task.OfflineUpdate.access$3(OfflineUpdate.java:74)
11-08 18:40:29.805: W/System.err(26464): at task.OfflineUpdate$1.run(OfflineUpdate.java:59)
11-08 18:40:29.806: W/System.err(26464): at java.lang.Thread.run(Thread.java:856)
11-08 18:40:29.807: W/System.err(26464): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-08 18:40:29.808: W/System.err(26464): at libcore.io.Posix.open(Native Method)
11-08 18:40:29.810: W/System.err(26464): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-08 18:40:29.810: W/System.err(26464): at libcore.io.IoBridge.open(IoBridge.java:393)
11-08 18:40:29.812: W/System.err(26464): ... 9 more
我不知道如何访问该目录..有人可以启发我吗?