1.2.7.4.14 SYS_FS_FileNameGet Function
1.2.7.4.14 C
bool SYS_FS_FileNameGet
(
SYS_FS_HANDLE handle,
uint8_t* cName,
uint16_t wLen
);
1.2.7.4.14 Summary
Reads the file name.
1.2.7.4.14 Description
This function reads the file name of a file that is already open.
1.2.7.4.14 Precondition
The file handle referenced by handle is already open.
1.2.7.4.14 Parameters
| Parameters | Description |
|---|---|
| handle | File handle obtained during file Open |
| cName | Where to store the name of the file |
| wLen | The maximum length of data to store in cName |
1.2.7.4.14 Returns
True - If the file name was read successfully.
False - If the file name was not read successfully. The reason for the failure can be retrieved with SYS_FS_Error.
1.2.7.4.14 Example
SYS_FS_HANDLE fileHandle; bool stat; uint8_t fileName[255]; fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.txt", (SYS_FS_FILE_OPEN_READ)); if(fileHandle != SYS_FS_HANDLE_INVALID) { // File open is successful } ... ... stat = SYS_FS_FileNameGet(fileHandle, fileName, 8 ); if(stat == false) { // file not located based on handle passed // Check the error state using SYS_FS_FileError }
1.2.7.4.14 Remarks
None.
