Home | Previous Page | Next Page   Function Descriptions >

mi_file_errno( )

The mi_file_errno( ) function returns the value of the system errno variable after a file input/output (I/O) operation. This value is the last errno value generated during an mi_file* function call and comes from the computer where the file is located. This function does not translate the value from one platform to another.

Syntax

mi_integer mi_file_errno( )
Valid in Client LIBMI Application? Valid in User-Defined Routine?
Yes Yes

Usage

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.

UNIX/Linux Only

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.

End of UNIX/Linux Only
Windows Only

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.

End of Windows Only
Server Only

This function can access the errno value only for a file that resides on a server computer.

End of Server Only

Return Values

None.

Related Topics

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( ).

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]