Previous: ncmpi_get_file_info, Up: Files [Index]
The function ncmpi_inq_files_opened reports the number of files and their IDs that are currently opened.
This API is an independent subroutine.
int ncmpi_inq_files_opened(int *num, int *ncids);
num
[Output] number of files. This argument cannot be NULL.
ncids
[Output] array of netCDF IDs, each corresponding to an opened file. This argument can be NULL.
ncmpi_inq_files_opened returns the value NC_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:
Here is an example using ncmpi_inq_files_opened.
#include <pnetcdf.h> ... int status, num, *ncids; ... /* inquire the number of file opened */ status = ncmpi_inq_files_opened(&num, NULL); if (status != NC_NOERR) handle_error(status); /* allocate ncids array */ ncids = malloc(num * sizeof(int); /* inquire the list of ncids */ status = ncmpi_inq_files_opened(&num, ncids); if (status != NC_NOERR) handle_error(status);
Previous: ncmpi_get_file_info, Up: Files [Index]