AnsweredAssumed Answered

MFS Multiple file open

Question asked by Nitin Kothari on Aug 12, 2014
Latest reply on Aug 14, 2014 by Nitin Kothari

Hello,

 

I am using MFS with MQX on MCF54418.

 

If I try to open second file with one file already open, the fopen returns NULL and it fails.

 

This is how I am opening File1.txt :

 

//Declare File system structure

typedef struct

{

  MQX_FILE_PTR DEV_FD_PTR;

  MQX_FILE_PTR PM_FD_PTR;

  MQX_FILE_PTR FS_FD_PTR;

  char_ptr     DEV_NAME;

  char_ptr     PM_NAME;

  char_ptr     FS_NAME;

 

} USB_FILESYSTEM_STRUCT, _PTR_ USB_FILESYSTEM_STRUCT_PTR;

 

//Create an instance

USB_FILESYSTEM_STRUCT stUsbFileSystem; 

 

//Open File1.txt

stUsbFileSystem.FS_FD_PTR = fopen("C:\\File1.txt", "r");

 

 

Now my question is, how to proceed if I have  to open File2.txt without closing File1.txt ?

 

Any help is greatly appreciated !

 

Regards,

Nitro

Outcomes