func OpenFile(name string, flags int) (*File, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))
	hid := C.H5Fopen(c_name, C.uint(flags), P_DEFAULT.id)
	if err := checkID(hid); err != nil {
		return nil, fmt.Errorf("error opening hdf5 file: %s", err)
	}
	return newFile(hid), nil
}
Opens an existing HDF5 file.
package hdf5
import "C"
import (
	"fmt"
	"runtime"
	"unsafe"
)
const (
	F_ACC_RDONLY  int = 0x0000  
	F_ACC_RDWR    int = 0x0001  
	F_ACC_TRUNC   int = 0x0002  
	F_ACC_EXCL    int = 0x0004  
	F_ACC_DEBUG   int = 0x0008  
	F_ACC_CREAT   int = 0x0010  
	F_ACC_DEFAULT int = 0xffff  
)
type Scope C.H5F_scope_t
const (
	F_SCOPE_LOCAL  Scope = 0  
	F_SCOPE_GLOBAL Scope = 1  
)
type File struct {
	CommonFG
}
func (f *File) finalizer() {
	if err := f.Close(); err != nil {
		panic(fmt.Errorf("error closing file: %s", err))
	}
}
func newFile(id C.hid_t) *File {
	f := &File{CommonFG{Location{Identifier{id}}}}
	runtime.SetFinalizer(f, (*File).finalizer)
	return f
}
func CreateFile(name string, flags int) (*File, error) {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))
	hid := C.H5Fcreate(c_name, C.uint(flags), P_DEFAULT.id, P_DEFAULT.id)
	if err := checkID(hid); err != nil {
		return nil, fmt.Errorf("error creating hdf5 file: %s", err)
	}
	return newFile(hid), nil
}