2023-04-10 15:36:59 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-10-27 00:57:07 +00:00
|
|
|
package agent
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (l *logFile) createTime(stat os.FileInfo) time.Time {
|
|
|
|
// Use `ModTime` as an approximation if the exact create time is not
|
|
|
|
// available.
|
|
|
|
// On Windows, the file create time is not updated after the active log
|
|
|
|
// rotates, so use `ModTime` as an approximation as well.
|
|
|
|
return stat.ModTime()
|
|
|
|
}
|