當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Attr.Mode方法代碼示例

本文整理匯總了Golang中github.com/y-okubo/go-fuse/fuse.Attr.Mode方法的典型用法代碼示例。如果您正苦於以下問題:Golang Attr.Mode方法的具體用法?Golang Attr.Mode怎麽用?Golang Attr.Mode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/y-okubo/go-fuse/fuse.Attr的用法示例。


在下文中一共展示了Attr.Mode方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetAttr

func (n *defaultNode) GetAttr(out *fuse.Attr, file File, context *fuse.Context) (code fuse.Status) {
	if n.Inode().IsDir() {
		out.Mode = fuse.S_IFDIR | 0755
	} else {
		out.Mode = fuse.S_IFREG | 0644
	}
	return fuse.OK
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:8,代碼來源:defaultnode.go

示例2: HeaderToFileInfo

func HeaderToFileInfo(out *fuse.Attr, h *tar.Header) {
	out.Mode = uint32(h.Mode)
	out.Size = uint64(h.Size)
	out.Uid = uint32(h.Uid)
	out.Gid = uint32(h.Gid)
	out.SetTimes(&h.AccessTime, &h.ModTime, &h.ChangeTime)
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:7,代碼來源:tarfs.go

示例3: GetAttr

func (fs *unionFsFile) GetAttr(out *fuse.Attr) fuse.Status {
	code := fs.File.GetAttr(out)
	if code.Ok() {
		out.Mode |= 0200
	}
	return code
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:7,代碼來源:unionfs.go

示例4: GetAttr

func (n *memNode) GetAttr(out *fuse.Attr, file nodefs.File, context *fuse.Context) fuse.Status {
	if n.Inode().IsDir() {
		out.Mode = fuse.S_IFDIR | 0777
		return fuse.OK
	}
	n.file.Stat(out)
	return fuse.OK
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:8,代碼來源:memtree.go

示例5: lookupMountUpdate

func (c *FileSystemConnector) lookupMountUpdate(out *fuse.Attr, mount *fileSystemMount) (node *Inode, code fuse.Status) {
	code = mount.mountInode.Node().GetAttr(out, nil, nil)
	if !code.Ok() {
		log.Println("Root getattr should not return error", code)
		out.Mode = fuse.S_IFDIR | 0755
		return mount.mountInode, fuse.OK
	}

	return mount.mountInode, fuse.OK
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:10,代碼來源:fsops.go

示例6: GetAttr

func (fs *FSetAttrFs) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status) {
	if name == "" {
		return &fuse.Attr{Mode: fuse.S_IFDIR | 0700}, fuse.OK
	}
	if name == "file" && fs.file != nil {
		var a fuse.Attr
		fs.file.getAttr(&a)
		a.Mode |= fuse.S_IFREG
		return &a, fuse.OK
	}
	return nil, fuse.ENOENT
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:12,代碼來源:fsetattr_test.go

示例7: GetAttr

func (f *dataFile) GetAttr(out *fuse.Attr) fuse.Status {
	out.Mode = fuse.S_IFREG | 0644
	out.Size = uint64(len(f.data))
	return fuse.OK
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:5,代碼來源:files.go

示例8: Stat

func (f *TarFile) Stat(out *fuse.Attr) {
	HeaderToFileInfo(out, &f.Header)
	out.Mode |= syscall.S_IFREG
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:4,代碼來源:tarfs.go

示例9: GetAttr

func (f *dataFile) GetAttr(out *fuse.Attr) fuse.Status {
	log.Print("dataFile.GetAttr()", " ", out)
	out.Mode = fuse.S_IFREG | 0775
	out.Size = uint64(len(f.data))
	return fuse.OK
}
開發者ID:y-okubo,項目名稱:nekofs,代碼行數:6,代碼來源:file.go

示例10: Lookup

func (n *nodeReadNode) Lookup(out *fuse.Attr, name string, context *fuse.Context) (*Inode, fuse.Status) {
	out.Mode = fuse.S_IFREG | 0644
	out.Size = uint64(len(name))
	ch := n.Inode().NewChild(name, false, newNodeReadNode([]byte(name)))
	return ch, fuse.OK
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:6,代碼來源:fileless_test.go

示例11: Stat

func (f *ZipFile) Stat(out *fuse.Attr) {
	// TODO - do something intelligent with timestamps.
	out.Mode = fuse.S_IFREG | 0444
	out.Size = uint64(f.File.UncompressedSize)
}
開發者ID:y-okubo,項目名稱:go-fuse,代碼行數:5,代碼來源:zipfs.go


注:本文中的github.com/y-okubo/go-fuse/fuse.Attr.Mode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。