Please, help us to better serve our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF5 2.0.0.258fa78
API Reference
Loading...
Searching...
No Matches
Java File (H5F) Interface

Detailed Description

See also
Files (H5F), C-API
HDF5 File, User Guide

Functions

static int H5Fclose (long file_id) throws HDF5LibraryException
 
static long H5Fopen (String name, int flags, long access_id) throws HDF5LibraryException, NullPointerException
 
static long H5Freopen (long file_id) throws HDF5LibraryException
 
static long H5Fcreate (String name, int flags, long create_id, long access_id) throws HDF5LibraryException, NullPointerException
 
static synchronized native int H5Fflush (long object_id, int scope) throws HDF5LibraryException
 
static long H5Fget_access_plist (long file_id) throws HDF5LibraryException
 
static long H5Fget_create_plist (long file_id) throws HDF5LibraryException
 
static synchronized native long H5Fget_filesize (long file_id) throws HDF5LibraryException
 
static synchronized native long H5Fget_freespace (long file_id) throws HDF5LibraryException
 
static synchronized native int H5Fget_intent (long file_id) throws HDF5LibraryException
 
static synchronized native long H5Fget_fileno (long file_id) throws HDF5LibraryException
 
static synchronized native double H5Fget_mdc_hit_rate (long file_id) throws HDF5LibraryException
 
static synchronized native int H5Fget_mdc_size (long file_id, long[] metadata_cache) throws HDF5LibraryException, NullPointerException, IllegalArgumentException
 
static synchronized native String H5Fget_name (long obj_id) throws HDF5LibraryException
 
static synchronized native long H5Fget_obj_count (long file_id, int types) throws HDF5LibraryException
 
static synchronized native long H5Fget_obj_ids (long file_id, int types, long max_objs, long[] obj_id_list) throws HDF5LibraryException, NullPointerException
 
static synchronized native boolean H5Fis_hdf5 (String name) throws HDF5LibraryException, NullPointerException
 
static synchronized native boolean H5Fis_accessible (String name, long fapl_id) throws HDF5LibraryException, NullPointerException
 
static synchronized native int H5Fmount (long loc_id, String name, long child_id, long plist_id) throws HDF5LibraryException, NullPointerException
 
static synchronized native int H5Funmount (long loc_id, String name) throws HDF5LibraryException, NullPointerException
 
static synchronized native void H5Freset_mdc_hit_rate_stats (long file_id) throws HDF5LibraryException
 
static synchronized native H5F_info2_t H5Fget_info (long obj_id) throws HDF5LibraryException
 
static synchronized native void H5Fclear_elink_file_cache (long file_id) throws HDF5LibraryException
 
static synchronized native void H5Fstart_swmr_write (long file_id) throws HDF5LibraryException
 
static synchronized native void H5Fstart_mdc_logging (long file_id) throws HDF5LibraryException
 
static synchronized native void H5Fstop_mdc_logging (long file_id) throws HDF5LibraryException
 
static synchronized native void H5Fget_mdc_logging_status (long file_id, boolean[] mdc_logging_status) throws HDF5LibraryException, NullPointerException
 
static synchronized native boolean H5Fget_dset_no_attrs_hint (long file_id) throws HDF5LibraryException
 
static synchronized native void H5Fset_dset_no_attrs_hint (long file_id, boolean minimize) throws HDF5LibraryException
 
static synchronized native void H5Fset_libver_bounds (long file_id, int low, int high) throws HDF5LibraryException
 

Function Documentation

◆ H5Fclear_elink_file_cache()

static synchronized native void H5Fclear_elink_file_cache ( long  file_id) throws HDF5LibraryException
static

H5Fclear_elink_file_cache evicts all the cached child files in the specified file's external file cache, causing them to be closed if there is nothing else holding them open.

Parameters
file_idIN: Identifier of the target file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fclose()

static int H5Fclose ( long  file_id) throws HDF5LibraryException
static

H5Fclose terminates access to an HDF5 file.

Parameters
file_idIdentifier of a file to terminate access to.
Returns
a non-negative value if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fcreate()

static long H5Fcreate ( String  name,
int  flags,
long  create_id,
long  access_id 
) throws HDF5LibraryException, NullPointerException
static

H5Fcreate is the primary function for creating HDF5 files.

Parameters
nameName of the file to access.
flagsFile access flags. Possible values include:
create_idFile creation property list identifier, used when modifying default file meta-data. Use H5P_DEFAULT for default access properties.
access_idFile access property list identifier. If parallel file access is desired, this is a collective call according to the communicator stored in the access_id (not supported in Java). Use H5P_DEFAULT for default access properties.
Returns
a file identifier if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.

◆ H5Fflush()

static synchronized native int H5Fflush ( long  object_id,
int  scope 
) throws HDF5LibraryException
static

H5Fflush causes all buffers associated with a file or object to be immediately flushed (written) to disk without removing the data from the (memory) cache.

After this call completes, the file (or object) is in a consistent state and all data written to date is assured to be permanent.

Parameters
object_idIdentifier of object used to identify the file. object_id can be any object associated with the file, including the file itself, a dataset, a group, an attribute, or a named data type.
scopespecifies the scope of the flushing action, in the case that the HDF5 file is not a single physical file.

Valid values are:

  • H5F_SCOPE_GLOBAL Flushes the entire virtual file.
  • H5F_SCOPE_LOCAL Flushes only the specified file.
Returns
a non-negative value if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_access_plist()

static long H5Fget_access_plist ( long  file_id) throws HDF5LibraryException
static

H5Fget_access_plist returns the file access property list identifier of the specified file.

Parameters
file_idIdentifier of file to get access property list of
Returns
a file access property list identifier if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_create_plist()

static long H5Fget_create_plist ( long  file_id) throws HDF5LibraryException
static

H5Fget_create_plist returns a file creation property list identifier identifying the creation properties used to create this file.

Parameters
file_idIdentifier of the file to get creation property list
Returns
a file creation property list identifier if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_dset_no_attrs_hint()

static synchronized native boolean H5Fget_dset_no_attrs_hint ( long  file_id) throws HDF5LibraryException
static

H5Fget_dset_no_attrs_hint gets the file-level setting to create minimized dataset object headers.

Parameters
file_idIN: Identifier of the target file.
Returns
true if the file-level is set to create minimized dataset object headers, false if not.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_fileno()

static synchronized native long H5Fget_fileno ( long  file_id) throws HDF5LibraryException
static

H5Fget_fileno retrieves the "file number" for an open file.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
Returns
the unique file number for the file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_filesize()

static synchronized native long H5Fget_filesize ( long  file_id) throws HDF5LibraryException
static

H5Fget_filesize retrieves the file size of the HDF5 file. This function is called after an existing file is opened in order to learn the true size of the underlying file.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
Returns
the file size of the HDF5 file
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_freespace()

static synchronized native long H5Fget_freespace ( long  file_id) throws HDF5LibraryException
static

H5Fget_freespace returns the amount of space that is unused by any objects in the file.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
Returns
the amount of free space in the file
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_info()

static synchronized native H5F_info2_t H5Fget_info ( long  obj_id) throws HDF5LibraryException
static

H5Fget_info returns global information for the file associated with the object identifier obj_id.

Parameters
obj_idIN: Object identifier for any object in the file.
Returns
A buffer(H5F_info2_t) for current "global" information about file
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_intent()

static synchronized native int H5Fget_intent ( long  file_id) throws HDF5LibraryException
static

H5Fget_intent retrieves the intended access mode flag passed with H5Fopen when the file was opened.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
Returns
the intended access mode flag, as originally passed with H5Fopen.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_mdc_hit_rate()

static synchronized native double H5Fget_mdc_hit_rate ( long  file_id) throws HDF5LibraryException
static

H5Fget_mdc_hit_rate queries the metadata cache of the target file to obtain its hit rate (cache hits / (cache hits + cache misses)) since the last time hit rate statistics were reset.

Parameters
file_idIN: Identifier of the target file.
Returns
the double in which the hit rate is returned.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_mdc_logging_status()

static synchronized native void H5Fget_mdc_logging_status ( long  file_id,
boolean[]  mdc_logging_status 
) throws HDF5LibraryException, NullPointerException
static

H5Fget_mdc_logging_status gets the current metadata cache logging status.

Parameters
file_idIN: Identifier of the target file.
mdc_logging_statusthe status mdc_logging_status[0] = is_enabled, whether logging is enabled mdc_logging_status[1] = is_currently_logging, whether events are currently being logged
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionmdc_logging_status is null.

◆ H5Fget_mdc_size()

static synchronized native int H5Fget_mdc_size ( long  file_id,
long[]  metadata_cache 
) throws HDF5LibraryException, NullPointerException, IllegalArgumentException
static

H5Fget_mdc_size queries the metadata cache of the target file for the desired size information.

Parameters
file_idIN: Identifier of the target file.
metadata_cacheOUT: Current metadata cache information
  • metadata_cache[0] = max_size_ptr // current cache maximum size
  • metadata_cache[1] = min_clean_size_ptr // current cache minimum clean size
  • metadata_cache[2] = cur_size_ptr // current cache size
Returns
current number of entries in the cache
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionmetadata_cache is null.

◆ H5Fget_name()

static synchronized native String H5Fget_name ( long  obj_id) throws HDF5LibraryException
static

H5Fget_name retrieves the name of the file to which the object obj_id belongs.

Parameters
obj_idIN: Identifier of the object for which the associated filename is sought.
Returns
the filename.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_obj_count()

static synchronized native long H5Fget_obj_count ( long  file_id,
int  types 
) throws HDF5LibraryException
static

H5Fget_obj_count returns the number of open object identifiers for the file.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
typesIN: Type of object for which identifiers are to be returned.
  • H5F_OBJ_FILE Files only
  • H5F_OBJ_DATASET Datasets only
  • H5F_OBJ_GROUP Groups only
  • H5F_OBJ_DATATYPE Named datatypes only
  • H5F_OBJ_ATTR Attributes only
  • H5F_OBJ_ALL All of the above
  • H5F_OBJ_LOCAL Restrict search to objects opened through current file identifier.
Returns
the number of open objects.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fget_obj_ids()

static synchronized native long H5Fget_obj_ids ( long  file_id,
int  types,
long  max_objs,
long[]  obj_id_list 
) throws HDF5LibraryException, NullPointerException
static

H5Fget_obj_ids returns the list of identifiers for all open HDF5 objects fitting the specified criteria.

Parameters
file_idIN: File identifier for a currently-open HDF5 file
typesIN: Type of object for which identifiers are to be returned.
max_objsIN: Maximum number of object identifiers to place into obj_id_list.
obj_id_listOUT: Pointer to the returned list of open object identifiers.
Returns
the number of objects placed into obj_id_list.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionobj_id_list is null.

◆ H5Fis_accessible()

static synchronized native boolean H5Fis_accessible ( String  name,
long  fapl_id 
) throws HDF5LibraryException, NullPointerException
static

H5Fis_accessible determines if the file can be opened with the given fapl.

Parameters
nameIN: File name to check.
fapl_idIN: File access property list identifier
Returns
true if file is accessible, false if not.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.

◆ H5Fis_hdf5()

static synchronized native boolean H5Fis_hdf5 ( String  name) throws HDF5LibraryException, NullPointerException
static

H5Fis_hdf5 determines whether a file is in the HDF5 format.

Parameters
nameFile name to check format.
Returns
true if is HDF5, false if not.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.
Deprecated:
As of HDF5 1.10.5 in favor of H5Fis_accessible.

◆ H5Fmount()

static synchronized native int H5Fmount ( long  loc_id,
String  name,
long  child_id,
long  plist_id 
) throws HDF5LibraryException, NullPointerException
static

H5Fmount mounts the file specified by child_id onto the group specified by loc_id and name using the mount properties plist_id.

Parameters
loc_idThe identifier for the group onto which the file specified by child_id is to be mounted.
nameThe name of the group onto which the file specified by child_id is to be mounted.
child_idThe identifier of the file to be mounted.
plist_idThe identifier of the property list to be used.
Returns
a non-negative value if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.

◆ H5Fopen()

static long H5Fopen ( String  name,
int  flags,
long  access_id 
) throws HDF5LibraryException, NullPointerException
static

H5Fopen opens an existing file and is the primary function for accessing existing HDF5 files.

Parameters
nameName of the file to access.
flagsFile access flags.
access_idIdentifier for the file access properties list.
Returns
a file identifier if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.

◆ H5Freopen()

static long H5Freopen ( long  file_id) throws HDF5LibraryException
static

H5Freopen reopens an HDF5 file.

Parameters
file_idIdentifier of a file to terminate and reopen access to.
Returns
a new file identifier if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Freset_mdc_hit_rate_stats()

static synchronized native void H5Freset_mdc_hit_rate_stats ( long  file_id) throws HDF5LibraryException
static

H5Freset_mdc_hit_rate_stats resets the hit rate statistics counters in the metadata cache associated with the specified file.

Parameters
file_idIN: Identifier of the target file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fset_dset_no_attrs_hint()

static synchronized native void H5Fset_dset_no_attrs_hint ( long  file_id,
boolean  minimize 
) throws HDF5LibraryException
static

H5Fset_dset_no_attrs_hint sets the file-level setting to create minimized dataset object headers.

Parameters
file_idIN: Identifier of the target file.
minimizethe minimize hint setting
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fset_libver_bounds()

static synchronized native void H5Fset_libver_bounds ( long  file_id,
int  low,
int  high 
) throws HDF5LibraryException
static

H5Fset_libver_bounds sets a different low and high bounds while a file is open.

Parameters
file_idIN: Identifier of the target file.
lowIN: The earliest version of the library that will be used for writing objects
highIN: The latest version of the library that will be used for writing objects.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fstart_mdc_logging()

static synchronized native void H5Fstart_mdc_logging ( long  file_id) throws HDF5LibraryException
static

H5Fstart_mdc_logging starts logging metadata cache events if logging was previously enabled.

Parameters
file_idIN: Identifier of the target file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fstart_swmr_write()

static synchronized native void H5Fstart_swmr_write ( long  file_id) throws HDF5LibraryException
static

H5Fstart_swmr_write will activate SWMR writing mode for a file associated with file_id. This routine will prepare and ensure the file is safe for SWMR writing.

Parameters
file_idIN: Identifier of the target file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Fstop_mdc_logging()

static synchronized native void H5Fstop_mdc_logging ( long  file_id) throws HDF5LibraryException
static

H5Fstop_mdc_logging stops logging metadata cache events if logging was previously enabled and is currently ongoing.

Parameters
file_idIN: Identifier of the target file.
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.

◆ H5Funmount()

static synchronized native int H5Funmount ( long  loc_id,
String  name 
) throws HDF5LibraryException, NullPointerException
static

Given a mount point, H5Funmount disassociates the mount point's file from the file mounted there.

Parameters
loc_idThe identifier for the location at which the specified file is to be unmounted.
nameThe name of the file to be unmounted.
Returns
a non-negative value if successful
Exceptions
HDF5LibraryExceptionError from the HDF5 Library.
NullPointerExceptionname is null.