SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
This function renames an existing file; for secure files, the rename requires the master token.
Table 9-11 shows a partial list of errors that might be returned by the rename function.
Error | Description |
---|---|
SL_ERROR_FS_FILE_IS_ALREADY_OPENED | File that is opened cannot be renamed. The file is expected to be closed or aborted to be renamed. |
SL_ERROR_FS_FILE_NAME_RESERVED | System file cannot be renamed, and file cannot be renamed to a system filename. |
SL_ERROR_FS_FILE_NAME_EXIST | Renaming a file to a filename that already exists results in an error. |
Example:
_i32 Status;
_u8 DeviceFileName[180], NewDeviceFileName[180];
_u32 Token;
Status = sl_FsCtl(SL_FS_CTL_RENAME, Token, DeviceFileName, NewDeviceFileName, 0, NULL, 0, NULL );
if( Status < 0 )
{
/*error */
}