mfs- delete file MFS_BAD_DISK_UNIT

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

mfs- delete file MFS_BAD_DISK_UNIT

1,216件の閲覧回数
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 返答(返信)

831件の閲覧回数
BryGuyH
Contributor IV

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

0 件の賞賛
返信

831件の閲覧回数
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 件の賞賛
返信