6.2.2 Procedure
The procedure for listing the files and their respective allocated space is as follows:
- Keep the following information for every user file created:
- Filename
- Calculate file size according to Section 4.
- Loop over all user files and print:
- Filename
- Calculated size
- Loop over all system/configuration files, invoke fsGetInfo() API and conclude:
- If return value is SL_FS_ERR_FILE_NOT_EXISTS, file does not exist and thus should not be printed. Else, the file exists and should be printed along with the allocated size
- If return value is SL_FS_ERR_TOKEN_IS_NOT_VALID, it means the file is secured but exists. This return value applies to the following three files:
- /tmp/fcon.frm
- /sys/pref.net
- /sys/smartconfigkeys.cfg
In this case, the file exists and should be printed along with the allocated size.
Figure 2 illustrates the procedure.