SWRU368C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
This operation enables deleting an existing file from the serial flash. If the file does not exist on the serial flash, an error is generated. Upon deleting a file, its occupied space on the serial flash is freed and made available for re-allocation by the system.
_i16 sl_FsDel(_u8 *pFileName,
_u32 Token);
Type | Parameter | In/Out | Description |
---|---|---|---|
_u8 | pFileName | In | Pointer to the target file name. NULL terminated |
_u32 | Token | In | Reserved for future use in secured file system. Should be 0 |
On success, zero is returned. On error, an error code is returned.
_u8 DeviceFileName[] = "MyFile.txt";
_u32 MaxSize = 63 * 1024;
_i32 DeviceFileHandle = -1;
_i32 RetVal;
_u32 Token;
RetVal = sl_FsOpen(DeviceFileName,
FS_MODE_OPEN_CREATE(MaxSize , _FS_FILE_OPEN_FLAG_COMMIT ),
NULL,
&DeviceFileHandle);
RetVal = sl_FsClose(DeviceFileHandle,
NULL,
NULL,
NULL );
Token = 0;
RetVal = sl_FsDel(DeviceFileName,
Token);
None