[Back to Interface] [Prev]

HXsetdir/hxisdir

intn HXsetdir(char *dir)

dir IN:

Target directory of the external file to be located

Purpose

Initializes the directory environment variable, identifying the location of the external file to be located.

Return value

Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.

Description

HXsetdir sets the directory variable for locating an external file according to dir which may contain multiple directories separated by vertical bars (e.g., "dir1|dir2"). The content of dir is copied into the private memory of the HDF library. If dir is NULL, the directory variable is unset.

If HXsetdir encounters any error, the directory variable is not changed. By default, the HDF library locates the external file just like the open call. It also searches for the external file in the directories specified by the user environment variable $HDFEXTDIR, if defined, and the directory variable set by HXsetdir. The searching precedence is directory variable, if set, then $HDXEXTDIR, then in the manner of open.

The searching differs if the external filename is an absolute pathname - i.e., starting with a forward slash. HDF will try open first. If open fails and if $HDFEXTDIR is defined or the directory variable is set via HXsetdir, HDF will remove all directory components of the absolute pathname (e.g., "/usr/groupA/projectB/Data001" becomes "Data001") and search for that filename with the strategy described in the previous paragraph.

The dir_len parameter in the FORTRAN-77 routine specifies the length of the dir character string.

FORTRAN

integer function hxisdir(dir, dir_len)

character*(*) dir

integer dir_len



[Back to Interface] [Prev]

hdfhelp@ncsa.uiuc.edu
HDF Reference Manual - 07/29/98, NCSA HDF Development Group.