【问题标题】:PepperMount Write operation failsPepperMount 写入操作失败
【发布时间】:2012-07-27 05:28:58
【问题描述】:

我正在尝试使用 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");
}

我在 Pepper_20 和 Pepper_21 中尝试过,在 20 中打开文件失败,在 21 中写操作失败。 让我知道这是一个已知错误还是我的代码有问题。

【问题讨论】:

    标签: file-io google-nativeclient


    【解决方案1】:

    问题实际上不在于代码。似乎我也必须从 html 请求存储配额。

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

    【讨论】:

      猜你喜欢
      • 2016-02-10
      • 2019-01-25
      • 2020-09-14
      • 2020-03-25
      • 1970-01-01
      • 2014-12-25
      • 2014-11-09
      • 1970-01-01
      • 2011-06-30
      相关资源
      最近更新 更多