Search found 4 matches
- Mon Aug 21, 2023 10:40 am
- Forum: ESP-IDF
- Topic: fputs(), fputc() appending string/characters twice issue
- Replies: 6
- Views: 1136
Re: fputs(), fputc() appending string/characters twice issue
What I think is happening is that after programming, the ESP32 is reset and will actually run without its output being captured. Then, a little bit later when the terminal program starts up again, the ESP32 is reset again and the program will run a second time. If my hunch is correct, the first tim...
- Mon Aug 21, 2023 8:26 am
- Forum: ESP-IDF
- Topic: fputs(), fputc() appending string/characters twice issue
- Replies: 6
- Views: 1136
Re: fputs(), fputc() appending string/characters twice issue
How are you sure, what reason do you have for that? If anything, your second point makes it more likely that your program somehow gets run twice as the append works fine if you have a guaranteed-empty file before it runs. EDIT: For shits and giggles, can you take the code that exhibits the problem ...
- Mon Aug 21, 2023 6:27 am
- Forum: ESP-IDF
- Topic: fputs(), fputc() appending string/characters twice issue
- Replies: 6
- Views: 1136
Re: fputs(), fputc() appending string/characters twice issue
Well, you're opening the file to append; are you sure your program didn't run one time before and dropped the initial 'world' there, with you looking at the second time where it appended the second 'world'? I am sure and one more thing is that if I open the file in write mode, empty string, close t...
- Sun Aug 20, 2023 11:03 pm
- Forum: ESP-IDF
- Topic: fputs(), fputc() appending string/characters twice issue
- Replies: 6
- Views: 1136
fputs(), fputc() appending string/characters twice issue
When opening a file in append mode and start putting a string into file stream then closing the file and opening the file again in read mode it shows the string is written/flushed twice. Example code: char *txt = "World"; FILE *fs_a = fopen("/filesPartitionFatfs/test.txt", "a"); fputs(txt, fs_a); fc...