Windows phone 8 windows phone 8 cocos2d-x中的写入权限

Windows phone 8 windows phone 8 cocos2d-x中的写入权限,windows-phone-8,cocos2d-x,Windows Phone 8,Cocos2d X,我在cocos2d-x中有一个应用程序,用户可以在文本文件中添加数据,并可以随时删除内容 要创建文本文件,请使用getWritablepath函数创建文件 std::string path = CCFileUtils::sharedFileUtils()->getWritablePath() + "demo.txt"; FILE* file = fopen(path.c_str(), "a+"); 要删除内容。。除删除的内容外,用户需要的所有内容都将复制到临时文件中,原始文件将被删除,临

我在cocos2d-x中有一个应用程序,用户可以在文本文件中添加数据,并可以随时删除内容

要创建文本文件,请使用getWritablepath函数创建文件

std::string path = CCFileUtils::sharedFileUtils()->getWritablePath() + "demo.txt";
FILE* file = fopen(path.c_str(), "a+");
要删除内容。。除删除的内容外,用户需要的所有内容都将复制到临时文件中,原始文件将被删除,临时文件将被重命名

std::string path_temp = CCFileUtils::sharedFileUtils()->getWritablePath() + "temp1.txt";
FILE* file_temp = fopen(path_temp.c_str(), "a+");
const char* break1 = "~";


for (int i=0;i< array1->count(); i++) {
    CCString *string=(CCString *)array1->objectAtIndex(i);
    const char* tmp1 = string->getCString();
    file = fopen(path_temp.c_str(), "a+");
    ifstream is;

    is.open (path_temp.c_str(), ios::binary| ios::ate );
    int length = is.tellg();
    is.close();
    cout<<"size by new"<<length;

    if(tmp2!=tmp1){

        if(length==0){

            fputs(tmp1, file_temp);
            fclose(file_temp);
        }
        else
        {
            fputs(break1,file_temp);
            fputs(tmp1, file_temp);
               fclose(file_temp);
        }


    }
}
array1->removeObjectAtIndex(tag);
remove(path.c_str());                       // This particular function remove rename   gives error as write permission denied
rename(path_temp.c_str(), path.c_str());
std::string path_temp=CCFileUtils::sharedFileUtils()->getWritablePath()+“temp1.txt”;
FILE*FILE_temp=fopen(路径_temp.c_str(),“a+”;
常量字符*break1=“~”;
对于(int i=0;icount();i++){
CCString*string=(CCString*)数组1->objectAtIndex(i);
const char*tmp1=string->getCString();
file=fopen(path_temp.c_str(),“a+”);
如果流是;
is.open(path_temp.c_str(),ios::binary | ios::ate);
int length=is.tellg();
is.close();
库特