Exodus 7.10

Functions | Variables
ex_open.c File Reference
`#include "exodusII.h"`
`#include "exodusII_int.h"`

## Functions
int | ex_open_int (const char *path, int mode, int *comp_ws, int *io_ws, float *version, int run_version)

## Variables
static int | warning_output = 0

## Function Documentation

## ◆ ex_open_int()

int ex_open_int | ( | const char * | path,
|  | int | mode,
|  | int * | comp_ws,
|  | int * | io_ws,
|  | float * | version,
|  | int | run_version
| ) |  |

## Variable Documentation

## ◆ warning_output

int warning_output = 0
| static

Note
  The ex_open_int() is an internal function called by ex_open(). The user should call ex_open() and not ex_open_int().

The function ex_open() opens an existing exodus file and returns an ID that can subsequently be used to refer to the file, the word size of the floating point values stored in the file, and the version of the exodus database (returned as a `float'', regardless of the compute or I/O word size). Multiple files may be`open'' simultaneously.

Returns
  In case of an error, ex_open() returns a negative number. Possible causes of errors include:
  - The specified file does not exist.
  - The mode specified is something other than the predefined constant EX_READ or EX_WRITE.
  - Database version is earlier than 2.0.

Parameters

  | path | The file name of the exodus file. This can be given as either an absolute path name (from the root of the file system) or a relative path name (from the current directory).
  | mode | Access mode. Use one of the following predefined constants: EX_READ To open the file just for reading. EX_WRITE To open the file for writing and reading.
  [in,out] | comp_ws | The word size in bytes (0, 4 or 8) of the floating point variables used in the application program. If 0 (zero) is passed, the default size of floating point values for the machine will be used and returned in this variable. WARNING: all exodus functions requiring reals must be passed reals declared with this passed in or returned compute word size (4 or 8).
  [in,out] | io_ws | The word size in bytes (0, 4 or 8) of the floating point data as they are stored in the exodus file. If the word size does not match the word size of data stored in the file, a fatal error is returned. If this argument is 0, the word size of the floating point data already stored in the file is returned.
  [out] | version | Returned exodus database version number. Note that this is always a float, never a double.

The following opens an exodus file named `test.exo` for read only, using default settings for compute and I/O word sizes:

int CPU_word_size,IO_word_size, exoid;
float version;
CPU_word_size = sizeof(float); /* float or double */
IO_word_size = 0; /* use what is stored in file */
/* open exodus files */
exoid = ex_open ("test.exo", /* filename path */
EX_READ, /* access mode = READ */
&CPU_word_size, /* CPU word size */
&IO_word_size, /* IO word size */
&version); /* ExodusII library version */