Methods
clean(x) → {undefined|Promise.<undefined>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
x |
string | Uint8Array | Return value of |
Returns:
Any resources used by get
to return x
can be freed.
For example, if x
is a path referring to a temporary file, it can be removed.
No value is returned, though the method may be asynchronous.
- Type
- undefined | Promise.<undefined>
copy(from, to) → {undefined|Promise.<undefined>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
from |
string | Local path to a file to be copied, see |
to |
string | Local path to the new location of the file, see |
Returns:
The contents of from
are copied to to
.
No value is returned, though the method may be asynchronous.
- Type
- undefined | Promise.<undefined>
exists(path) → {boolean|Promise.<boolean>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Local path to a file, see |
Returns:
Whether the path
exists.
- Type
- boolean | Promise.<boolean>
get(path, optionsopt) → {Uint8Array|string|Promise.<(Uint8Array|string)>}
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
path |
string | Local path to a file. This should lie inside some application-specific concept of a directory, even if a local filesystem does not exist (e.g., an S3 bucket, or a Zip archive). |
||||||||||||
options |
object |
<optional> |
{}
|
Further options. Properties
|
Returns:
Relative or absolute path to the file on the local filesystem.
If asBuffer = true
or if no local filesystem is available, a Uint8Array of the file contents is returned instead.
A promise of a string or Uint8Array may also be returned.
Callers should pass the (Promise-resolved) return value to clean
once the file is no longer required.
- Type
- Uint8Array | string | Promise.<(Uint8Array|string)>
h5close(handle) → {undefined|Promise.<undefined>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
handle |
H5Group | Return value of |
Returns:
This should execute clean-up operations when the file used in h5open
is no longer needed.
No value is returned, possibly asynchronously.
- Type
- undefined | Promise.<undefined>
h5create(path) → {H5Group|Promise.<H5Group>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Local path to a HDF5 file to be created.
As with |
Returns:
A read-write handle to a new HDF5 file, or a promise thereof. This may refer to, e.g., a temporary file in a virtual filesystem, if no local filesystem exists.
h5finish(handle, failed) → {Uint8Array|Promise.<?Uint8Array>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
handle |
H5Group | Return value of |
failed |
boolean | Whether an error occurred when writing to the HDF5 file. |
Returns:
This should execute clean-up operations when no more write operations are to be performed on the file returned by h5create
.
If failed = true
, any existing resources associated with the file may be deleted, and null
should be returned, possibly asynchronously.
- Type
- Uint8Array | Promise.<?Uint8Array>
h5open(path) → {H5Group|Promise.<H5Group>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Local path to a HDF5 file.
As with |
Returns:
A read-only handle to the HDF5 file, or a promise thereof.
mkdir(path) → {undefined|Promise.<undefined>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Local path to a directory.
As with |
Returns:
A new directory is created at path
.
(This may be a no-op if the application does not support creation of directories.)
No value is returned, though the method may be asynchronous.
- Type
- undefined | Promise.<undefined>
write(path, contents) → {undefined|Promise.<undefined>}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
path |
string | Local path to a file, see |
contents |
Uint8Array | Contents of the file. |
Returns:
contents
is stored at path
.
The exact nature of this storage depends on the application -
it may involve saving a file to the local filesystem, or uploading a file to a server, etc.
If path
already exists, it should be overwritten with contents
.
No value is returned, though the method may be asynchronous.
- Type
- undefined | Promise.<undefined>