怎么在android 上获取文件路径

来源:互联网 发布:手机语音控制软件 编辑:程序博客网 时间:2024/04/27 09:16

std::string nameBuf = CCFileUtils::sharedFileUtils()->fullPathForFilename(string->getCString());
我用的这个方法  
在xcode 上是
/Users/zyl/Library/Application Support/iPhone Simulator/6.1/Applications/97E6E21F-8B6B-4CBB-AF35-4CB60B5BC500/ZylBook.app/3.txt
在 eclispe 上是
assets/3.txt
我要 进行文件操作    
        FILE *pF;
        pF = fopen(nameBuf.c_str(), "r");
在eclipse 上 在这就崩了
3.txt 我放在resources  这个文件夹 下面
怎么在 android 上获取完整的文件路径

这些也是我的困惑,待解决
0 0