Save and access files in SPIFFS file system

Please let me know if anyone know how to save and access any data file in spiffs file system of esp8266 programmatically .I want to save data in file present in spiffs FS . Data is coming on UART of esp8266. Please let me know how much bigger file size save in spiffs FS of ESP8266. I read lot of article on google that says it can not more then 512 KB size.
Also please let me know if any other way to hold data for some time.

Thanks
Abhishek Goel

The default filesystem sizes are: 128KB for 1MB and 2MB of flash, 256KB for >=4MB of flash.
It is possible to create an extra partition for a device with >=4MB of flash.
It is also possible to add an external SPI flash device.

The maximum file size depends of the FS size and the sizes of the files already existing.

can you provide me any example in which create and access files present in file system.

C library’s file operations are available.

is it use with mongoose os

How this functions use for esp , can I use this in c source file which is present in src folder of mongoose
setup.I am using mongoose os for developing firmware of esp8266. please let me know.

Sure, it’s plain C.

Examples