SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
Deleting of a file removes its storage from the file system and updates the files allocation table. Deleting is done by the host function sl_FsDel().
On successful delete, the file allocation storage on the SFLASH is removed, and can be used by other files. For secure files, the delete requires the file master token.
TI recommends minimizing the number of delete file operations, because it involves updating the allocation table.
Table 9-10 shows a partial list of errors that might be returned by the delete function.
Error | Description |
---|---|
SL_ERROR_FS_FILE_IS_ALREADY_OPENED | File that is opened cannot be deleted. The file is expected to be closed or aborted to be deleted; trying to delete a file opened for write/read results in this error. |
SL_ERROR_FS_FILE_NOT_EXISTS | Trying to delete a file which does not exist results in this error. |
Example:
_i16 Status;
_u8 DeviceFileName[180];
_u32 MasterToken;
Status = sl_FsDel( DeviceFileName, MasterToken );
if( Status < 0 )
{
/*error */
}