The mi_file_allocate() function
The mi_file_allocate() function ensures that a specified number of files are available to be opened.
Syntax
mi_integer mi_file_allocate(num_files)
mi_integer num_files
- num_files
- specifies how many file descriptors to allocate.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
The mi_file_allocate() function
allocates num_files number of file descriptors for use with
operating-system calls, such as UNIX™ open() or fopen().
Tip: The mi_file_allocate() function is provided
for compatibility with earlier versions only. This function is not
required for file access in DataBlade®
API modules.
In new code, use DataBlade
API file-access
functions such as mi_file_open() and mi_file_close().
Server only: This function does not perform
any tasks when called within a UDR.
Return values
- >=0
- The number of file descriptors that mi_file_allocate() has allocated.
- MI_ERROR
- The function was not successful.
The mi_file_allocate() function does not throw an MI_Exception event when it encounters a runtime error. It does not cause callbacks to start.