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

Function RenamedFileInfo

drive/driveimpl/shared/stat.go:44–61  ·  view source on GitHub ↗
(ctx context.Context, name string, fi fs.FileInfo)

Source from the content-addressed store, hash-verified

42func (fi *StaticFileInfo) Sys() any { return nil }
43
44func RenamedFileInfo(ctx context.Context, name string, fi fs.FileInfo) *StaticFileInfo {
45 var birthTime time.Time
46 var birthTimeErr error
47 birthTimer, ok := fi.(webdav.BirthTimer)
48 if ok {
49 birthTime, birthTimeErr = birthTimer.BirthTime(ctx)
50 }
51
52 return &StaticFileInfo{
53 Named: Base(name),
54 Sized: fi.Size(),
55 Moded: fi.Mode(),
56 BirthedTime: birthTime,
57 BirthedTimeErr: birthTimeErr,
58 ModdedTime: fi.ModTime(),
59 Dir: fi.IsDir(),
60 }
61}
62
63// ReadOnlyDirInfo returns a static fs.FileInfo for a read-only directory
64func ReadOnlyDirInfo(name string, ts time.Time) *StaticFileInfo {

Callers

nothing calls this directly

Calls 6

BaseFunction · 0.85
ModeMethod · 0.80
ModTimeMethod · 0.80
BirthTimeMethod · 0.45
SizeMethod · 0.45
IsDirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…