1.2.7.4.7 SYS_FS_FileClose Function
1.2.7.4.7 C
SYS_FS_RESULT SYS_FS_FileClose
(
SYS_FS_HANDLE handle
);
1.2.7.4.7 Summary
Closes a file.
1.2.7.4.7 Description
This function closes an opened file. Before closing the file it performs a force sync to write any pending data to the file.
1.2.7.4.7 Precondition
A valid file handle must be obtained before closing a file.
1.2.7.4.7 Parameters
| Parameters | Description |
|---|---|
| handle | A valid handle, which was obtained while opening the file |
1.2.7.4.7 Returns
SYS_FS_RES_SUCCESS - File close operation was successful.
SYS_FS_RES_FAILURE - File close operation failed. The reason for the failure can be retrieved with SYS_FS_Error or SYS_FS_FileError.
1.2.7.4.7 Example
SYS_FS_HANDLE fileHandle;
fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.txt", (SYS_FS_FILE_OPEN_READ));
if(fileHandle != SYS_FS_HANDLE_INVALID)
{
// File open is successful
}
SYS_FS_FileClose(fileHandle);
1.2.7.4.7 Remarks
None.
