SWRU368C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
This operation enables getting file information of an existing file. If the file does not exist on the serial flash, an error is generated.
_i16 sl_FsGetInfo (_u8 *pFileName,
_u32 Token,
SlFsFileInfo_t* pFsFileInfo);
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 |
SlFsFileInfo_t* | pFsFileInfo | Out | File Information: flags, file size, allocated size and Tokens. Look on below structure. |
typedef struct
{
_u16 flags;
_u32 FileLen;
_u32 AllocatedLen;
_u32 Token[4];
}SlFsFileInfo_t;
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;
SlFsFileInfo_t FsFileInfo;
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_FsGetInfo(DeviceFileName,
Token,
&FsFileInfo);
None
The ability of the web server to access the file system is limited to www/ prefix as a root folder.