I tried a simple example but I can't open a file. Is there a volume name that I need to specify? I presume you don't need to create a directory.
Here is the code, but the open fails with "No such file or directory"
// TEST File System
char *test_string = "This is data";
int32_t fp;
printf("FS Test: Writing:\n");
fp = red_open("/test_file", RED_O_CREAT | RED_O_WRONLY);
if (fp != -1) {
printf("Writing string\n");
int32_t numOfBytesWritten = red_write(fp, test_string, strlen(test_string));
if (numOfBytesWritten == strlen(test_string)) {
printf("Success\n");
} else {
printf("Write returned: %d\n",numOfBytesWritten);
if (numOfBytesWritten == -1)
printf("Unable to write to file: %s\n", red_strerror(red_errno));
}
int32_t rc = red_close(fp);
if (rc != 0) {
printf("Unable to close file: %s\n", red_strerror(red_errno));
}
} else {
printf("Unable to open file: %s\n", red_strerror(red_errno));
}
Any thoughts?
73
Chris