rotation_linux.go 541 B

12345678910111213141516171819202122
  1. //go:build linux
  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. return newSysInfo.Ino != curSysInfo.Ino ||
  15. newSysInfo.Size < curSysInfo.Size ||
  16. newSysInfo.Ctim.Nano() > curSysInfo.Ctim.Nano()
  17. }