]>
cloudbase.mooo.com Git - z180-stamp.git/blob - fatfs/documents/res/app1.c
1 /*------------------------------------------------------------/
2 / Open or create a file in append mode
3 / (This function was sperseded by FA_OPEN_APPEND flag at FatFs R0.12a)
4 /------------------------------------------------------------*/
7 FIL
* fp
, /* [OUT] File object to create */
8 const char* path
/* [IN] File name to be opened */
13 /* Opens an existing file. If not exist, creates a new file. */
14 fr
= f_open(fp
, path
, FA_WRITE
| FA_OPEN_ALWAYS
);
16 /* Seek to end of the file to append data */
17 fr
= f_lseek(fp
, f_size(fp
));
31 /* Open or create a log file and ready to append */
33 fr
= open_append(&fil
, "logfile.txt");
34 if (fr
!= FR_OK
) return 1;
37 f_printf(&fil
, "%02u/%02u/%u, %2u:%02u\n", Mday
, Mon
, Year
, Hour
, Min
);