Ejemplo n.º 1
0
// Open an environment handle. If this function fails Close() must be called to discard the Env handle.
func (env *Env) Open(path string, flags uint, mode uint) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ret := C.mdb_env_open(env._env, cpath, C.uint(flags), C.mdb_mode_t(mode))
	if ret != SUCCESS {
		return Errno(ret)
	}
	return nil
}
Ejemplo n.º 2
0
Archivo: env.go Proyecto: ngaut/bmdb
// Open an environment handle. If this function fails Close() must be called to discard the Env handle.
func (env *Env) Open(path string, flags uint, mode uint) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))
	ret := C.mdb_env_open(env._env, cpath, C.uint(NOTLS|flags), C.mdb_mode_t(mode))
	return errno(ret)
}