pilot-link icon indicating copy to clipboard operation
pilot-link copied to clipboard

Open file with vfsModeWrite causes read-only error with dlp_VFSFileWrite()

Open CoSoCo opened this issue 3 years ago • 0 comments

pi_buffer_t *buf;
// fill buf ...
FileRef fileRef;
dlp_VFSFileOpen(sd, volRef, path, vfsModeWrite, &fileRef);
PI_ERR piErr = dlp_VFSFileWrite(sd, fileRef, buf->data, buf->used);
if (piErr == PI_ERR_DLP_PALMOS)
    printf("PalmOS error: %d.\n", pi_palmos_error(sd));

Result:

PalmOS error: 10757  // vfsErrFilePermissionDenied = The file is read only

Current workaround: use vfsModeReadWrite instead vfsModeWrite.

CoSoCo avatar Sep 05 '22 11:09 CoSoCo