Im trying to create a file inside a directory, or simply read a file from a directory. Here is my code:
#include<stdio.h>
#include <cc3.h> #include <cc3_ilp.h>
void initialize(void);
int main(void) {
initialize(); FILE * f = NULL;
f = fopen("c:/hi/hi.txt","w"); if (f == NULL)
perror("could not open c:/hi/hi.txt");
else
printf("Congratulations Meng!");
return 0; }
void initialize(void) {
cc3_filesystem_init();
cc3_uart_init (0,
CC3_UART_RATE_115200, CC3_UART_MODE_8N1, CC3_UART_BINMODE_TEXT);
setvbuf (stdout, NULL, _IONBF, 0); setvbuf (stdin, NULL, _IONBF, 0);
cc3_camera_init ();
//cc3_set_colorspace(CC3_COLORSPACE_YCRCB); cc3_camera_set_resolution(CC3_CAMERA_RESOLUTION_LOW); // cc3_pixbuf_set_subsample (CC3_SUBSAMPLE_NEAREST, 2, 2); cc3_timer_wait_ms(1000);
// init pixbuf with width and height cc3_pixbuf_load(); setvbuf (stdout, NULL, _IONBF, 0); setvbuf (stdin, NULL, _IONBF, 0);
}
Whether or not the directory exists, i always get the error could not open c:/hi/hi.txt: Is a directory
I am running a 2gb SD SanDisk? card