beautypg.com

Datasetfindnextfile function, Datasetfindclose function – HP XP P9500 Storage User Manual

Page 130

background image

2.

datasetError = datasetFindNextFile (datasetHandle, &ffd)

The datasetFindNextFile function acquires the attribute information for the next dataset in
the volume specified by datasetHandle and returns the data into ffd. This function can be
repeated until “no dataset found” is returned or until the user application determines that no more
information is needed.

Table 48

on page 130 shows the datasetFindNextFile arguments

and return values.

Table 48 DatasetFindNextFile Function

Description

Type

Value

Item

DatasetHandle (value returned by the pre-
ceding datasetFindFirstFile func-
tion)

DATASET_HANDLE

datasetHandle

Argument

Attribute information (area where the
dataset attribute information is stored)

DATASET_FIND_DATA

ffd

Return value

Normal end

0

Abnormal end or no dataset found

-1

When the datasetFindNextFile function terminates successfully, it returns a value of 0. If
this function terminates unsuccessfully, it returns a value of -1. To get the error code information,
execute the datasetGetLastError function (see

Acquiring Error Information

” on page 127).

For example, when the datasetFindNextFile function cannot find the next dataset in the
VTOC, the datasetGetLastError function will return DATASET_ERROR_END_OF_VTOC.

The datasetFindNextFile function has the following restrictions:

• The datasetFindNextFile function cannot be used on an open dataset. Use this function

before opening or after closing the dataset.

• After a dataset has been accessed by the datasetFindNextFile function, the dataset

cannot be opened until after the datasetFindClose function is called.

• The datasetFindFirstFile function must be called prior to datasetFindNextFile.

3.

datasetError = datasetFindClose (datasetHandle)

The datasetFindClose function terminates the acquisition of attribute information by the
datasetFindFirstFile

and datasetFindNextFile functions and closes the dataset. The

datasetFindFirstFile

function must be called prior to datasetFindClose.

Table

49

on page 130 shows the datasetFindClose arguments and return values.

Table 49 DatasetFindClose Function

Description

Type

Value

Item

DatasetHandle (value returned by the pre-
ceding datasetFindFirstFile func-
tion)

DATASET_HANDLE

datasetHandle

Argument

Normal end

0

Return value

Abnormal end

-1

When the datasetFindClose function terminates successfully, it returns a value of 0. If this
function terminates unsuccessfully, it returns a value of -1. To get the error code information,
execute the datasetGetLastError function (see

Acquiring Error Information

” on page 127).

Performing FAL Operations

130