mi_integer mi_file_errno( )
Valid in Client LIBMI Application? | Valid in User-Defined Routine? |
---|---|
Yes | Yes |
File I/O functions of the C library call underlying system or platform file I/O functions. These system or platform functions set a global variable called errno to indicate status. For a list of DataBlade API file-access functions, see the IBM Informix: DataBlade API Programmer's Guide.
These file-access functions call the corresponding C library functions to perform their tasks. Therefore, the value of the errno is available for a DataBlade API module.
On UNIX or Linux, you can check the errno variable directly, immediately after a DataBlade API file I/O function. Therefore, use of mi_file_errno( ) is not required for UNIX or Linux. In fact, the mi_file_errno( ) function on UNIX or Linux is the same as the errno variable.
If you plan to port a user-defined routine (UDR) or DataBlade module to Windows, it is strongly recommended that you use the mi_file_errno( ) to retrieve the errno value.
On Windows, global variables, such as errno, are not easily accessible. Therefore, to obtain the errno value after a DataBlade API file I/O operation, use the mi_file_errno( ) function. DataBlade APIs and UDRs that execute on the Windows platform must use mi_file_errno( ) to access the errno for file operations.
This function can access the errno value only for a file that resides on a server computer.
None.
See also the descriptions of mi_file_allocate( ), mi_file_close( ), mi_file_open( ), mi_file_read( ), mi_file_seek( ), mi_file_sync( ), mi_file_tell( ), and mi_file_to_file( ).