1.2.7.4.12 SYS_FS_FileSize Function
1.2.7.4.12 C
int32_t SYS_FS_FileSize
(
SYS_FS_HANDLE handle
);
1.2.7.4.12 Summary
Returns the size of the file in bytes.
1.2.7.4.12 Description
This function returns the size of the file as pointed by the handle.
1.2.7.4.12 Precondition
A valid file handle must be obtained before knowing a file size.
1.2.7.4.12 Parameters
| Parameters | Description |
|---|---|
| handle | File handle obtained during file Open |
1.2.7.4.12 Returns
On success - Returns the size of the file in bytes.
On failure - Returns -1. The reason for the failure can be retrieved with SYS_FS_Error or SYS_FS_FileError.
1.2.7.4.12 Example
SYS_FS_HANDLE fileHandle; long fileSize; fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.txt", (SYS_FS_FILE_OPEN_READ)); if(fileHandle != SYS_FS_HANDLE_INVALID) { // File open is successful } ... ... fileSize = SYS_FS_FileSize(fileHandle); if(fileSize != -1) { // Success }
1.2.7.4.12 Remarks
None.
