MCPcopy
hub / github.com/perkeep/perkeep / checkModtime

Function checkModtime

dev/devcam/devcam.go:208–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206}
207
208func checkModtime() error {
209 binModtime, err := selfModTime()
210 if err != nil {
211 return fmt.Errorf("could not get ModTime of current devcam executable: %v", err)
212 }
213
214 devcamDir := filepath.Join(camliSrcRoot, "dev", "devcam")
215 d, err := os.Open(devcamDir)
216 if err != nil {
217 return fmt.Errorf("could not read devcam source dir %v: %v", devcamDir, err)
218 }
219 defer d.Close()
220 fis, err := d.Readdir(-1)
221 if err != nil {
222 return fmt.Errorf("could not read devcam source dir %v: %v", devcamDir, err)
223 }
224 for _, fi := range fis {
225 if fi.ModTime().After(binModtime) {
226 log.Printf("**************************************************************")
227 log.Printf("WARNING: your devcam binary is outdated, you should rebuild it")
228 log.Printf("**************************************************************")
229 return nil
230 }
231 }
232 return nil
233}
234
235// build builds the named perkeep targets.
236// Each target may have its "perkeep.org" prefix removed.

Callers 1

mainFunction · 0.85

Calls 6

selfModTimeFunction · 0.85
PrintfMethod · 0.80
OpenMethod · 0.65
CloseMethod · 0.65
ReaddirMethod · 0.65
ModTimeMethod · 0.45

Tested by

no test coverage detected