desrod / pilot-link

pilot-link is a suite of tools used to connect your Palm or PalmOS® compatible handheld with Unix, Linux, and any other POSIX-compatible machine.
GNU General Public License v2.0
11 stars 7 forks source link

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

Open CoSoCo opened 2 years ago

CoSoCo commented 2 years ago
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.