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
You made sure to close the file pointer before you tried to delete the file right?
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