文件操作函数:
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 */
)
这样调用正常:
res = f_open(&fdst, "0:/music/xd2.mp3", FA_OPEN_EXISTING | FA_READ);
但是这样失败:
char dir[30];
sprintf(&dir[0],"0:/music/xd2.mp3");
res = f_open(&fdst, ( const TCHAR*)&dir[0], FA_OPEN_EXISTING | FA_READ);
就是如何实现路径文件名可变改的方式打开的呢? |