fdopen不工作

时间:2012-03-09 19:19:26

标签: android android-ndk java-native-interface

问题是打开和fdopen工作,代码:

    LOGI("opened %s", strerror( errno ));
    int handle= open("/mnt/sdcard/license.rar",O_RDONLY);
    LOGI("opened %s", strerror( errno ));
    FILE* hNewFile= fdopen(handle,"r");
    LOGI("opened handle %d hNewFile %d %s",handle, hNewFile, strerror( errno ));

对应的日志文件:

03-09 14:12:40.151: opened No such file or directory
03-09 14:12:40.160: opened No such file or directory
03-09 14:12:40.160: opened handle 3 hNewFile 0 Invalid argument

我确实拥有正确的清单权限

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

有什么想法吗?

0 个答案:

没有答案