[Top] [Prev] [Next] [Bottom]

SDstart/sfstart

int32 SDstart(char *filename, int32 access_mode)
filename

IN:

Name of the HDF file

access_mode

IN:

The SDS access mode in effect during the current session

Purpose

Opens the HDF file and initializes the SD interface.

Return value

Returns an sd_id if successful and FAIL (or -1) otherwise.

Description

This routine opens a file and returns an sd_id. This routine must be called for each file before any other SD calls can be made on that file. The access_mode parameter is one of the following:

DFACC_READ - Open existing file for read-only access. If the file doesn't exist, specifying this mode will result in an error condition.

DFACC_WRITE - Open existing file for read and write access. If the file doesn't exist, specifying this mode will result in an error condition.

DFACC_CREATE - Create a new file with read and write access. If the file does exist, the contents of this file will be deleted before any new writes occur (the file contents will be replaced).

The file can be any one of the following:an XDR-based netCDF file, "old-style" DFSD file or a "new-style" SD file.

If access_mode is set to DFACC_CREATE "new-style" SD files will be created. If access_mode is set to DFACC_RDONLY, the specified file will not be created if it doesn't exist.

The type of identifier returned by SDstart is currently not the same as the identifier returned by Hopen. As a result, sd_ids are not understood by other HDF interfaces and h_ids are not recognized by the SD interface.

To mix SD calls and other HDF library calls, use SDstart and Hopen on the same file. SDstart must precede all SD calls, and Hopen must proceed all other HDF function calls. To terminate access to the file, use both SDend and Hclose to dispose of the sd_id and the h_id.

FORTRAN

integer function sfstart(filename, access_mode)

character* (*) filename

integer access_mode



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.