[Back to Interface] [Prev]

HDFopen/hdfopen

int32 HDFopen(char *filename, intn access, int16 n_dds)

filename IN:

Complete path and filename for the file to be opened

access IN:

File access code

n_dds IN:

Number of data descriptors in a block if a new file is to be created

Purpose

Provides an access path to an HDF file by reading all the data descriptor blocks into memory.

Return value

Returns the file identifier if successful and FAIL (or -1) otherwise.

Description

If given a new file name, HDFopen will create a new file using the specified access type and number of data descriptors. If given an existing file name, HDFopen will open the file using the specified access type and ignore the n_dds argument.

HDF provides several file access code definitions:

DFACC_READ - Open for read only. If file does not exist, an error condition results.

DFACC_CREATE - If file exists, delete it, then open a new file for read/write.

DFACC_WRITE - Open for read/write. If file does not exist, create it.

If a file is opened and an attempt is made to reopen the file using DFACC_CREATE, HDF will issue the error DFE_ALROPEN. If the file is opened with read only access and an attempt is made to reopen the file for write access using DFACC_RDWR, DFACC_WRITE, or DFACC_ALL, HDF will attempt to reopen the file with read and write permissions.

Upon successful exit, the named file is opened with the relevant permissions, the data descriptors are set up in memory, and the associated file_id is returned. For new files, the appropriate file headers are also set up.

FORTRAN

integer function hdfopen(filename, access, n_dds)

character*(*) filename

integer access, n_dds



[Back to Interface] [Prev]

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