6.7.1SHOW FILE VALIDITY
Syntax
SHOW FILE VALIDITY file_name [, file_name]* [BY NAME]
[post_processing_option]
[output_redirecting_option]
Description
Show (i.e. get) the validity of a file named file_name (i.e. whether it is a valid HDF5 file or not). Multiple files can be checked at once for their validity by separating their names with a comma (,). If file_name was not found or its validity could not be obtained (due to unknown/unexpected reasons), no subsequent files are checked, and an error is raised.
Parameter(s)
file_name – mandatory string that specifies the name of the file whose validity is to be obtained.
post_processing_option – optional option that transforms the result set according to the programmer’s needs, such as ordering or truncating (please refer to the section PROCESSING for additional information).
output_redirecting_option – optional option that specifies the cursor in use, an HDF5 object (i.e. dataset or attribute), a (text, binary, or Excel) file, or memory (i.e. user-defined variable) to write the result set into (please refer to the subsection INTO for additional information). If not specified, the cursor in use is populated with the result set instead (please refer to the chapter CURSOR for additional information).
Return
If the keyword BY NAME is not specified, it returns the validity of a file as an HDFQL_INT, which can either be HDFQL_YES or HDFQL_NO depending on whether the file is a valid HDF5 file or not, respectively. Otherwise, if the keyword BY NAME is specified, it returns the validity of a file as an HDFQL_VARCHAR, which can either be “YES” or “NO”.
Example(s)
# create an HDF5 file named "my_file.h5"
CREATE FILE my_file.h5
# show (i.e. get) validity of file "my_file.h5" (should return 0 (i.e. HDFQL_YES))
SHOW FILE VALIDITY my_file.h5
# show (i.e. get) validity of a file named "not_an_hdf5_file.xml" (should return -1 (i.e. HDFQL_NO)) (assuming that the file "not_an_hdf5_file.xml" exists and contains XML text)
SHOW FILE VALIDITY not_an_hdf5_file.xml
# show (i.e. get) validity of both files "my_file.h5" and "not_an_hdf5_file.xml" at once (should return 0, -1)
SHOW FILE VALIDITY my_file.h5, not_an_hdf5_file.xml
# show (i.e. get) validity of both files "my_file.h5" and "not_an_hdf5_file.xml" at once by name (should return "YES", "NO")
SHOW FILE VALIDITY my_file.h5, not_an_hdf5_file.xml BY NAME