This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Function fopen can not work

Other Parts Discussed in Thread: MSP430F5438A

Hi, TI

I have questions about how to use fopen function to write the data to a file.

I use IAR on the board MSP430f5438a.

In the project i have data to watch and i need to put them into a file.txt.

This is my code in Main function :

FILE *pFile ;

 while((pFile = fopen("D:\\record.txt","w")) == NULL) ; 

 led_off(0) ;
                        //fwrite((char*)pucCC3000_Rx_Buffer, sizeof(char), 10, pFile) ;
                        //fprintf(pFile, "%d\n", 444) ;
                        //putc(pucCC3000_Rx_Buffer[0], pFile) ;


 fwrite(pucCC3000_Rx_Buffer, sizeof(char), 10, pFile) ;
                        
 fclose(pFile) ;

At the first step i have a headache probelem that i cant creat and open the file record.txt. I cant find it in the path D.

i have tried to change the parameters in my project and it dosent work. The Header stdio.h i have added it.

The programm wait always in the while loop and pFile is always NULL.

Could someone help me or give me a guide ?

Thanks a lot for helping me

**Attention** This is a public forum