Exemplo n.º 1
0
//export ll_OpenDir
func ll_OpenDir(id C.int, ino C.fuse_ino_t, fi *C.struct_fuse_file_info) C.int {
	fs := GetRawFs(int(id))
	info := newFileInfo(fi)
	err := fs.OpenDir(int64(ino), info)
	if err == OK {
		fi.fh = C.uint64_t(info.Handle)
	}
	return C.int(err)
}
Exemplo n.º 2
0
//export ll_Create
func ll_Create(id C.int, dir C.fuse_ino_t, name *C.char, mode C.mode_t,
	fi *C.struct_fuse_file_info, cent *C.struct_fuse_entry_param) C.int {

	fs := GetRawFs(int(id))
	info := newFileInfo(fi)
	ent, err := fs.Create(int64(dir), C.GoString(name), int(mode), info)
	if err == OK {
		ent.toCEntry(cent)
		fi.fh = C.uint64_t(info.Handle)
	}
	return C.int(err)
}