0

ソースコードはすでにFedora15,16とUbuntu10、11、12でテストされており、問題はありません。

しかし、Fedora 17では、ファイル書き込み機能が機能しませんでした。

1)

int fd;
if ( 0 < ( fd = open("/home/test/temp/opentest.html", O_CREAT | O_EXCL, 0777))) {
    write(fd, "test", strlen("test"));
    close(fd);
    return "Success";
} else {
    return "Error";
}

戻り値:エラー

2)

FILE *pFile;
pFile = fopen("/home/test/temp/opentest.html", "w+");
if (pFile == NULL) {
    return "Pointer is NULL";
} else {
    fputs("fopen test", pFile);
    fclose(pFile);
    return "Success";
}

戻り値:「ポインタはNULLです」

ディレクトリの権限でエラーが発生し、777の権限が設定されていると思います。しかし、何も変わりません。

同じコードが通常のCプログラムで機能しました。

なぜfirebreathnpPluginで機能しなかったのですか?

許可について何か違いはありますか?

4

1 に答える 1

0

ほとんどの場合、ディレクトリが存在しないか、書き込み権限がありません。

このコマンドは機能しますか?
echo 123 > /home/test/temp/opentest.html

于 2012-06-20T09:21:19.897 に答える