[Back to Interface] [Prev] [Next]


int32 SDstart(char *filename, int32 access_mode)



Name of the HDF file



The file access mode in effect during the current session


Opens an HDF file and initializes an SD interface.

Return value

Returns an SD interface identifier if successful and FAIL (or -1) otherwise.


SDstart opens the file with the name specified by the parameter filename, with the access mode specified by the parameter access_mode, and returns an SD interface identifier (sd_id). This routine must be called for each file before any other SD calls can be made on that file.

The type of identifier returned by SDstart is currently not the same as the identifier returned by Hopen. As a result, the SD interface identifiers (sd_id) returned by this routine are not understood by other HDF interfaces.

To mix SD API calls and other HDF API calls, use SDstart and Hopen on the same file. SDstart must precede all SD calls, and Hopen must precede all other HDF function calls. To terminate access to the file, use SDend to dispose of the SD interface identifier, sd_id, and Hclose to dispose of the file identifier, file_id.

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

The value of the parameter access_mode can be one of the following:

DFACC_READ - Open existing file for read-only access. If the file does not exist, specifying this mode will cause SDstart to return FAIL (or -1).

DFACC_WRITE - Open existing file for read and write access. If the file does not exist, specifying this mode will cause SDstart to return FAIL (or -1).

DFACC_CREATE - Create a new file with read and write access. If the file has already existed, its contents will be replaced.


integer function sfstart(filename, access_mode)

character*(*) filename

integer access_mode

[Back to Interface] [Prev] [Next]

HDF Reference Manual - 04/08/98, NCSA HDF Development Group.