Trying to create a new file on a working filesystem and getting this error:
ERR|File open for write failed -- Error #: -5
Here is the code:
void MyInstance::CreateFile(int32_t /* result */) {
if (!file_system_ready_) {
ShowErrorMessage("File system is not open", PP_ERROR_FAILED);
return;
}
pp::FileRef ref(file_system_,"foo.txt");
pp::FileIO file(this);
int32_t open_result =
file.Open(ref,PP_FILEOPENFLAG_WRITE | PP_FILEOPENFLAG_CREATE | PP_FILEOPENFLAG_TRUNCATE, pp::BlockUntilComplete());
if (open_result != PP_OK) {
ShowErrorMessage("File open for write failed", open_result); //here is the error
return;
}
}