2020-09-27 19:24:08 +00:00
|
|
|
package filesystem
|
2019-04-07 21:45:23 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2021-01-16 20:03:55 +00:00
|
|
|
// CTime returns the time that the file/folder was created.
|
2019-04-07 21:45:23 +00:00
|
|
|
func (s *Stat) CTime() time.Time {
|
2021-01-16 20:03:55 +00:00
|
|
|
st := s.Sys().(*syscall.Stat_t)
|
2019-04-07 21:45:23 +00:00
|
|
|
|
2020-09-05 19:08:40 +00:00
|
|
|
return time.Unix(st.Ctimespec.Sec, st.Ctimespec.Nsec)
|
|
|
|
}
|