MCPcopy Create free account
hub / github.com/cogentcore/core / LatestFileMod

Method LatestFileMod

filetree/find.go:144–163  ·  view source on GitHub ↗

LatestFileMod returns the most recent mod time of files in the tree. If cat is != fileinfo.Unknown then it only uses files of that type (e.g., fileinfo.Code to find any code files)

(cat fileinfo.Categories)

Source from the content-addressed store, hash-verified

142// If cat is != fileinfo.Unknown then it only uses files of that type
143// (e.g., fileinfo.Code to find any code files)
144func (fn *Node) LatestFileMod(cat fileinfo.Categories) time.Time {
145 tmod := time.Time{}
146 fn.WidgetWalkDown(func(cw core.Widget, cwb *core.WidgetBase) bool {
147 sfn := AsNode(cw)
148 if sfn == nil {
149 return tree.Continue
150 }
151 if cat != fileinfo.UnknownCategory {
152 if sfn.Info.Cat != cat {
153 return tree.Continue
154 }
155 }
156 ft := (time.Time)(sfn.Info.ModTime)
157 if ft.After(tmod) {
158 tmod = ft
159 }
160 return tree.Continue
161 })
162 return tmod
163}

Callers

nothing calls this directly

Calls 2

WidgetWalkDownMethod · 0.80
AsNodeFunction · 0.70

Tested by

no test coverage detected