Opening a dataset -4, Ion opening a dataset), Opening a dataset – HP XP20000XP24000 Disk Array User Manual

Page 158

Advertising
background image

6-4

Performing File Access Library (FAL) Operations

Hitachi USP V Cross-OS File Exchange User’s Guide

Opening a Dataset

datasetHandle = datasetOpen (pathname, mode)

The datasetOpen function opens the dataset specified by pathname for the

type of access specified by mode. Table 6-1 shows the datasetOpen
arguments and return values.

Table 6-1

DatasetOpen Function

Item Value

Type

Description

Argument

pathname



mode

char *



char *

VSN:Dataset name

VSN = 6-character volser.
Volume must be listed in FX volume definition file.
Delimiter = : (colon, no spaces allowed)
Dataset name: 44 characters max, no spaces allowed.

r = open dataset for read access

w = open dataset for write access

Return value datasetHandle

-1

DATASET_HAN
DLE

Handle

Error end

When the datasetOpen function terminates successfully, it returns a handle

which identifies the dataset opened. The datasetHandle information is used
as the argument of subsequent functions such as datasetGet, datasetPut, or
datasetClose. Do not change the datasetHandle value returned by this
function. If the datasetOpen function terminates unsuccessfully, it returns a

value of -1. To get the error code information, execute the
datasetGetLastError function (see section Acquiring Error Information).

The datasetOpen function has the following restrictions:

Only one dataset at a time can be open within one process. When multiple
datasets need to be opened, the open dataset must be closed before another
dataset can be opened. This restriction does not apply to open-system files.

A dataset which is being accessed by the datasetFindFirstFile or
datasetFindNextFile function cannot be opened. The datasetFindClose
function must be executed before the dataset can be opened. This restriction
does not apply to open-system files.

Advertising