19 lines
403 B
Go
19 lines
403 B
Go
//go:build darwin
|
|
|
|
package subscription
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
// creationTime returns the file's birth time on macOS, matching Python's
|
|
// stat.st_birthtime (subscription_manager.py:273-275).
|
|
func creationTime(info os.FileInfo) time.Time {
|
|
if stat, ok := info.Sys().(*syscall.Stat_t); ok {
|
|
return time.Unix(stat.Birthtimespec.Sec, stat.Birthtimespec.Nsec)
|
|
}
|
|
return info.ModTime()
|
|
}
|