MCPcopy
hub / github.com/rclone/rclone / stat

Method stat

cmd/cmount/fs.go:141–162  ·  view source on GitHub ↗

stat fills up the stat block for Node

(node vfs.Node, stat *fuse.Stat_t)

Source from the content-addressed store, hash-verified

139
140// stat fills up the stat block for Node
141func (fsys *FS) stat(node vfs.Node, stat *fuse.Stat_t) (errc int) {
142 Size := uint64(node.Size())
143 Blocks := (Size + 511) / 512
144 modTime := node.ModTime()
145 //stat.Dev = 1
146 stat.Ino = node.Inode() // FIXME do we need to set the inode number?
147 stat.Mode = getMode(node)
148 stat.Nlink = 1
149 stat.Uid = fsys.VFS.Opt.UID
150 stat.Gid = fsys.VFS.Opt.GID
151 //stat.Rdev
152 stat.Size = int64(Size)
153 t := fuse.NewTimespec(modTime)
154 stat.Atim = t
155 stat.Mtim = t
156 stat.Ctim = t
157 stat.Blksize = 512
158 stat.Blocks = int64(Blocks)
159 stat.Birthtim = t
160 // fs.Debugf(nil, "stat = %+v", *stat)
161 return 0
162}
163
164// Init is called after the filesystem is ready
165func (fsys *FS) Init() {

Callers 2

GetattrMethod · 0.95
ReaddirMethod · 0.95

Calls 4

getModeFunction · 0.70
SizeMethod · 0.65
ModTimeMethod · 0.65
InodeMethod · 0.65

Tested by

no test coverage detected