[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Create a HDF5 file
Syntax
| Visual Basic (Declaration) |
|---|
Public Shared Function create ( _ filename As String, _ mode As CreateMode, _ create_id As H5Id, _ access_id As H5Id _ ) As H5FileId |
| C# |
|---|
public static H5FileId create ( string filename, H5F.CreateMode mode, H5Id create_id, H5Id access_id ) |
| C++ |
|---|
public: static H5FileId^ create ( String^ filename, CreateMode mode, H5Id^ create_id, H5Id^ access_id ) |
Parameters
- filename (String)
- filename for new HDF5 file
- mode (CreateMode)
- H5F.CreateMode enumeration type that specifies such modes as read-only (H5F.CreateMode.ACC_RDONLY)
- create_id (H5Id)
- access_id (H5Id)
Return Value
a vaild H5FileId for the created file
Remarks
Keeping the H5Id class implemented as an abstract data type
provides
us the opportunity for future source-compatible library upgrades.
Examples
[C#]
int main()
{
// Call an hdf create function that generates an instance of
// H5Id
try
{
HDF5 myHDF5Id = H5F.create("myFile",
H5F.CreateMode.ACC_RDWR);
}
catch (HDF5Exception e)
{
Console.WriteLine(e.Message);
}
}
[Visual Basic .NET]
[C++/Cli]
int main()
{
// Call an hdf create function that generates an instance of
// H5Id
try
{
HDF5^ myHDF5Id =
H5F::create("myFile", H5F::CreateMode::ACC_RDWR);
}
catch (HDF5Exception^ e)
{
Console::WriteLine(e->Message);
}
}
Exceptions
| Exception | Condition |
|---|---|
| throws H5CreateException when create fails |