1.2.7.4.15 SYS_FS_Error Function
1.2.7.4.15 C
SYS_FS_ERROR SYS_FS_Error( void );
1.2.7.4.15 Summary
Returns the last error.
1.2.7.4.15 Description
When a file system operation fails, the application can know the reason of failure by calling the SYS_FS_Error. This function only reports the errors which are not file (or file handle) specific. For example, for functions, such as SYS_FS_Mount and SYS_FS_FileOpen, which do not take handle, any errors happening inside such function calls could be reported using SYS_FS_Error function.
Even for functions, which take handle as its input parameters, the SYS_FS_Error function can be used to report the type of error for cases where the passed handle itself is invalid.
1.2.7.4.15 Precondition
This function has to be called immediately after a failure is observed while doing a file operation.
Any subsequent failure will overwrite the cause of previous failure.
1.2.7.4.15 Parameters
None.
1.2.7.4.15 Returns
Error code of type SYS_FS_ERROR.
1.2.7.4.15 Example
SYS_FS_HANDLE fileHandle;
SYS_FS_ERROR err;
fileHandle = SYS_FS_FileOpen("/mnt/myDrive/FILE.txt", (SYS_FS_FILE_OPEN_READ));
if(fileHandle == SYS_FS_HANDLE_INVALID)
{
// If failure, now know the specific reason for failure
err = SYS_FS_Error();
}
1.2.7.4.15 Remarks
None.
