Hi,
I want to be able to read a textfile from My SD card line by line, change a line and save it in ML.
Can someone pretty please provide a simple example to read, write (create) and modify text files with ML.
Last time i tried was a year ago, and from memory the biggest issue i had was it seems you cant use normal string libraries.
Thanks
Easy: use a Lua script (the io functions should just work). See api_test for examples.
Fastest: read the entire file in memory (read_entire_file, which also allocates memory for you), but you need to do the line-based processing from scratch (see examples in config.c, menu.c). Ugly.
C string functions can be used, just add them to Makefile.src.config at the end (so they will be taken from dietlibc). You can also include the missing libc functions in a module (Lua does that).