File io PepperMount写入操作失败

File io PepperMount写入操作失败,file-io,google-nativeclient,File Io,Google Nativeclient,我试图使用PepperMount库在NACL中存储文件。但是我在将文件写入持久存储时遇到了一些问题 struct stat st; char data1[1000]; for (int i = 0; i < 1000; i++) data1[i] = 'a'; if(0 == ppMount->Creat("ccda.txt", 0, &st)) { fprintf(stderr, "File opened"); ppMount->Ref(st

我试图使用PepperMount库在NACL中存储文件。但是我在将文件写入持久存储时遇到了一些问题

struct stat st;
char data1[1000];
for (int i = 0; i < 1000; i++)
    data1[i] = 'a';

if(0 == ppMount->Creat("ccda.txt", 0, &st)) {
    fprintf(stderr, "File opened");
    ppMount->Ref(st.st_ino);

    ssize_t n = ppMount->Write(st.st_ino, 0, data1, 1000);
    fprintf(stderr, "Wrote %d bytes", n);

    ppMount->Unref(st.st_ino);
} else {
    fprintf(stderr, "File open failed");
}
struct stat st;
字符数据1[1000];
对于(int i=0;i<1000;i++)
数据1[i]=“a”;
如果(0==ppMount->Creat(“ccda.txt”、0和st)){
fprintf(标准格式,“文件已打开”);
ppMount->Ref(圣圣伊诺);
ssize\u t n=ppMount->Write(st.st\u ino,0,data1,1000);
fprintf(stderr,“写入%d字节”,n);
ppMount->Unref(圣圣伊诺);
}否则{
fprintf(stderr,“文件打开失败”);
}
我在Pepper_20和Pepper_21中尝试了它,在20中它在打开文件中失败,在21中它在写入操作中失败。
如果这是一个已知的bug,或者我的代码有问题,请告诉我。

问题实际上不是代码的问题。似乎我还需要从html请求存储配额

window.webkitStorageInfo.requestQuota(PERSISTENT, 20*1024*1024);