Hi Team,
I am trying to append a file in run time using spiffs. Attaching the code in which I have written "Hello World!" 10 times but it has printed only 1 time. Below is the output of my code.
I (282) spiffs example: Initializing SPIFFS
I (372) spiffs example: Partition size: total: 896321, used: 1004
I (382) spiffs example: Opening file
Appending file
Appending file
Appending file
Appending file
Appending file
Appending file
Appending file
Appending file
Appending file
Appending file
I (432) spiffs example: File written
I (432) spiffs example: Reading file
I (442) spiffs example: Read from file: 'Hello World!'
I (442) spiffs example: SPIFFS unmounted
Please suggest how to append string in a file using spiffs in run time??
Thanks
R.
How to append file using spiffs??
How to append file using spiffs??
- Attachments
-
- spiffs_example_main.c
- (2.93 KiB) Downloaded 758 times
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: How to append file using spiffs??
fgets only gets one line at a time, and you only call it once, so your code will only ever show the first line in the file, even if there are more. You probably meant to use something like fread instead.
Who is online
Users browsing this forum: No registered users and 108 guests