MCPcopy Create free account
hub / github.com/tailscale/tailscale / Stat

Method Stat

drive/driveimpl/dirfs/stat.go:15–30  ·  view source on GitHub ↗

Stat implements webdav.FileSystem.

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

13
14// Stat implements webdav.FileSystem.
15func (dfs *FS) Stat(ctx context.Context, name string) (fs.FileInfo, error) {
16 nameWithoutStaticRoot, isStaticRoot := dfs.trimStaticRoot(name)
17 if isStaticRoot || shared.IsRoot(name) {
18 // Static root is a directory, always use now() as the modified time to
19 // bust caches.
20 fi := shared.ReadOnlyDirInfo(name, dfs.now())
21 return fi, nil
22 }
23
24 child := dfs.childFor(nameWithoutStaticRoot)
25 if child == nil {
26 return nil, &os.PathError{Op: "stat", Path: name, Err: os.ErrNotExist}
27 }
28
29 return shared.ReadOnlyDirInfo(name, dfs.now()), nil
30}

Callers 1

OpenFileMethod · 0.95

Calls 5

trimStaticRootMethod · 0.95
nowMethod · 0.95
childForMethod · 0.95
IsRootFunction · 0.92
ReadOnlyDirInfoFunction · 0.92

Tested by

no test coverage detected