2020-09-27 19:24:08 +00:00
|
|
|
package filesystem
|
2019-04-07 21:45:23 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Returns the time that the file/folder was created.
|
|
|
|
func (s *Stat) CTime() time.Time {
|
|
|
|
st := s.Info.Sys().(*syscall.Stat_t)
|
|
|
|
|
2020-10-17 21:45:14 +00:00
|
|
|
// Do not remove these "redundant" type-casts, they are required for 32-bit builds to work.
|
|
|
|
return time.Unix(int64(st.Ctim.Sec), int64(st.Ctim.Nsec))
|
2020-09-05 19:08:40 +00:00
|
|
|
}
|