rotation_darwin.go 605 B

1234567891011121314151617181920212223
  1. //go:build darwin
  2. /*
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  6. */
  7. package main
  8. import (
  9. "syscall"
  10. )
  11. type FileSysInfo = *syscall.Stat_t
  12. const FileSysInfoStr = "*syscall.Stat_t"
  13. func fileWasRotated(newSysInfo, curSysInfo FileSysInfo) bool {
  14. // TODO I hope this is right. :^ Need to test this.
  15. return newSysInfo.Ino != curSysInfo.Ino ||
  16. newSysInfo.Size < curSysInfo.Size ||
  17. newSysInfo.Ctimespec.Nano() > curSysInfo.Ctimespec.Nano()
  18. }