中级会员
 
- 积分
- 230
- 金钱
- 230
- 注册时间
- 2015-6-4
- 在线时间
- 5 小时
|
5金钱
res=f_mount(&fs,"0",1);
if(res!=FR_OK)
{
printf("文件系统挂载失败!(%d)\r\n",res);
}
res=f_open(&file,"0:/Dir1/Dir1_1/fatfs.txt",FA_CREATE_ALWAYS|FA_READ);
if(res==FR_OK)
{
printf("文件已经正确打开!\r\n");
}
else
{
printf("文件打开失败!(%d)\r\n",res);
}
f_lseek(&file,file.fsize);
res=f_write(&file,"zhangxiaobin",12,&br);
if(res==FR_OK)
{
printf("文件写入成功!\r\n");
}
else
{
printf("文件写入失败!(%d)\r\n",res);
}
f_close(&file);
f_mount(&fs,"0:",0);
最终串口打印文件写入失败(7)
文件写入被拒绝,这是怎么回事啊?
大神们帮忙看看可否?谢谢啦!! |
|