Ejemplo n.º 1
0
func (me *HelloFs) Open(name string, flags uint32) (file fuse.File, code fuse.Status) {
	if name != "file.txt" {
		return nil, fuse.ENOENT
	}
	if flags&fuse.O_ANYWRITE != 0 {
		return nil, fuse.EPERM
	}
	return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
}
Ejemplo n.º 2
0
func (me *IrcFs) Open(name string, flags uint32) (file fuse.File, code fuse.Status) {
	log.Print("Open " + name)
	switch name {
	case "file.txt":
		return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
	case "ctl":
		return ctlFile, fuse.OK
	case "event":
		return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
	case "nick":
		return nickFile, fuse.OK
	case "raw":
		return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
	case "pong":
		return fuse.NewReadOnlyFile([]byte(name)), fuse.OK
	}
	return nil, fuse.ENOENT
}