/*##-2- Create and Open new text file objects with write access ######*/
retSD = f_open(&SDFile, filename, FA_CREATE_ALWAYS | FA_WRITE);
if(retSD)
printf(" open file error : %d\r\n",retSD);
else
printf(" open file sucess!!! \r\n");
这两个函数执行都是正确的,返回都是FR_OK
但是,我观测到 f_open 函数中
/*-----------------------------------------------------------------------*/
/* Open or Create a File */
/*-----------------------------------------------------------------------*/
FRESULT f_open (
FIL* fp, /* Pointer to the blank file object */
const TCHAR* path, /* Pointer to the file name */
BYTE mode /* Access mode and file open mode flags */
)
{
FRESULT res;
DIR dj;
FATFS *fs;
#if !_FS_READONLY
DWORD dw, cl, bcs, clst, sc;
FSIZE_t ofs;
#endif
DEF_NAMBUF