コード例 #1
0
ファイル: serve.go プロジェクト: rht/ipget
func (sn *serveNode) attr(ctx context.Context, attr *fuse.Attr) error {
	err := nodeAttr(ctx, sn.node, attr)
	if attr.Inode == 0 {
		attr.Inode = sn.inode
	}
	return err
}
コード例 #2
0
ファイル: serve.go プロジェクト: rht/ipget
func nodeAttr(ctx context.Context, n Node, attr *fuse.Attr) error {
	attr.Valid = attrValidTime
	attr.Nlink = 1
	attr.Atime = startTime
	attr.Mtime = startTime
	attr.Ctime = startTime
	attr.Crtime = startTime
	if err := n.Attr(ctx, attr); err != nil {
		return err
	}
	return nil
}
コード例 #3
0
ファイル: testfs.go プロジェクト: rht/ipget
func (f ChildMap) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0777
	return nil
}
コード例 #4
0
ファイル: testfs.go プロジェクト: rht/ipget
func (f File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = 0666
	return nil
}
コード例 #5
0
ファイル: hello.go プロジェクト: rht/ipget
func (File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 2
	a.Mode = 0444
	a.Size = uint64(len(greeting))
	return nil
}
コード例 #6
0
ファイル: hello.go プロジェクト: rht/ipget
func (Dir) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 1
	a.Mode = os.ModeDir | 0555
	return nil
}
コード例 #7
0
ファイル: tree.go プロジェクト: rht/ipget
func (t *tree) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0555
	return nil
}