示例#1
0
func (f *File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 2
	a.Mode = 0444
	t := f.content.Load().(string)
	a.Size = uint64(len(t))
	return nil
}
示例#2
0
文件: dir.go 项目: kildevaeld/vault
func zipAttr(f *zip.File, a *fuse.Attr) {
	a.Size = f.UncompressedSize64
	a.Mode = f.Mode()
	a.Mtime = f.ModTime()
	a.Ctime = f.ModTime()
	a.Crtime = f.ModTime()
}
示例#3
0
文件: file.go 项目: kildevaeld/vault
func (self *File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = 0755
	a.Size = self.item.Size
	t := time.Now()
	a.Crtime = t
	a.Ctime = t
	a.Mtime = t

	return nil
}
示例#4
0
文件: serve.go 项目: kildevaeld/vault
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
}
示例#5
0
文件: dir.go 项目: kildevaeld/vault
func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) error {
	if d.item == nil {
		// root directory
		a.Mode = os.ModeDir | 0755
		return nil
	}
	//zipAttr(d.file, a)
	return nil
}
示例#6
0
文件: serve.go 项目: kildevaeld/vault
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
}
示例#7
0
func (benchFile) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 2
	a.Mode = 0644
	a.Size = 9999999999999999
	return nil
}
示例#8
0
func (benchDir) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 1
	a.Mode = os.ModeDir | 0555
	return nil
}
示例#9
0
文件: tree.go 项目: kildevaeld/vault
func (t *tree) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0555
	return nil
}
示例#10
0
文件: hello.go 项目: kildevaeld/vault
func (File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Inode = 2
	a.Mode = 0444
	a.Size = uint64(len(greeting))
	return nil
}
示例#11
0
func (f *ChildMap) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = os.ModeDir | 0777
	return nil
}
示例#12
0
func (f File) Attr(ctx context.Context, a *fuse.Attr) error {
	a.Mode = 0666
	return nil
}