mfs- delete file MFS_BAD_DISK_UNIT

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

mfs- delete file MFS_BAD_DISK_UNIT

1,179 次查看
maite_gl
Contributor I

Hi everyone!

I try to delete a file with mfs (I use MQX 3.8) and it seems to work fine..

But when I create again a new file with a differente name, and I try to write something, this error appears --> MFS_BAD_DISK_UNIT

//Open a file --> I don't know if I should use "r"

fd_ptr = fopen(path, "r");

if (fd_ptr != NULL)  {

          error_code = ioctl(fd_ptr, IO_IOCTL_DELETE_FILE,(uint_32_ptr)path);

          if (error_code != MFS_NO_ERROR)

          { 

             error=1;  

          }

          else error=0;

}

it deletes ok!

but then I want to create other file and I when something I get MFS_BAD_DISK_UNIT error

Any idea?

Thankss!!

Maite

标签 (1)
0 项奖励
回复
2 回复数

794 次查看
BryGuyH
Contributor IV

You made sure to close the file pointer before you tried to delete the file right?

0 项奖励
回复

794 次查看
c0170
Senior Contributor III

Hello Maite gonzalez,

can you share with us code snippet how do you create new file? As I understand it, the code you posted is working, deleting the file. But it's missing a part which you are having a problem with.

Regards,

MartinK

0 项奖励
回复