Is there a way to get the total size of the flash0 FS and the available size in it???
You might look at the native file system API NAFSvolume_stats. This returns some information about used and free space. Besides that the only other thing that comes to mind would be to use NAFSopen_file_size but you have to open each existing file, call this APi and compare the total with the known size of FLASH. If you are looking for an API that just does "hey, FLASH0 how much free space to you have?". No such an API does not exist.
The APIs I have referenced above are described in the API reference manual.
thanks NAFSvolume_stats does what i needed