26 lines
440 B
Go
26 lines
440 B
Go
|
// Copyright (C) 2024 Umorpha Systems
|
||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||
|
|
||
|
package gitcache
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func touch(filename string) error {
|
||
|
fh, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY, 0o666)
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
return fh.Close()
|
||
|
}
|
||
|
|
||
|
func mtime(filename string) (time.Time, error) {
|
||
|
fi, err := os.Stat(filename)
|
||
|
if err != nil {
|
||
|
return time.Time{}, err
|
||
|
}
|
||
|
return fi.ModTime(), nil
|
||
|
}
|