大神们 相对路径的文件怎么用 fopen打不开啊

大神们 问个问题啊。 相对路径的文件在eclipse上怎么用fopen打不开啊,
我是vc代码移植eclipse上出现的这个问题 , vc上面正常运行 。 而在eclipse上面 打不开。

纠结死了 大神们 求救啊

FileUtils::getInstance()->fullPathForFilename(cszpPwdFileName);

试试这个

这个方法可以读取到文件 我试过了。 但是fileutil要怎么写文件啊? 我这是解密代码 要生成一个新文件的

fullPathForFilename只是获取路径啊, 还是一样的, 比如:

    std::string file_buffer = head + rc4_data;
    std::string fullFileName = StringUtils::format("%s.txt", m_strFileName.c_str());
    FILE* fp = fopen(fullFileName.c_str(), "w");
    if (fp)
    {
        fwrite(file_buffer.c_str(), file_buffer.size(), 1, fp);
        fclose(fp);
        this->printText(StringUtils::format("save %s.txt success!", m_strFileName.c_str()));
    }


```

文件读写不要使用C++的fopen,采用FileUtils这个类的相关函数,比如
writeToFile
getFileData
http://cn.cocos2d-x.org/doc/cocos2d-x-3.0/dc/d69/classcocos2d_1_1_file_utils.html