I get into this problem. I have a thread that process a message queue. One of my possible action on reception of a message is to open a file with the function fopen(). The file is located on a USB flashdisk and I am opening it with the option "w" : Logfile = fopen("U:\\Log.txt", "w");
I am using this file for logging. For testing purpose I am entering 200 values coming from ADC and then closing the file.
The first time the message is processed everything is fine. Now , the second time the message is received and process, the fopen() function is stalling for at least a minute then return with success and complete the following processing. I have noticed also that the connect and disconnect detection is not functioning normally too after the first fopen()/fclose().
Any ideas what could be the problem? Anything I need to know when opening, writing and closing a file?
Thank you