In fact, open (fopen) creates data (file pointer) in RAM, therefore you have to call close (fclose) in both functions.
However current version of MFS doesn’t allow you to open one file twice for write. MFS isn’t prepared for simultaneous write to one file and this situation should be handled by error code when you try opening file for write for the second time (I didn’t test it).
For now, I do not see any reason why I would like to open one file twice in the same task.
Anyway, next version of MFS will contain this feature (you can write simultaneously) and this new version of MFS will be available in next MQX release (probably MQX 4.2).
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------