times

#golang file times (atime, mtime, ctime, btime)

  • 所有者: djherbis/times
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

times

GoDoc
Release
Software License
Build Status
Coverage Status
Go Report Card
Sourcegraph

Usage

File Times for #golang

Go has a hidden time functions for most platforms, this repo makes them accessible.

package main

import (
  "log"

  "gopkg.in/djherbis/times.v1"
)

func main() {
  t, err := times.Stat("myfile")
  if err != nil {
    log.Fatal(err.Error())
  }

  log.Println(t.AccessTime())
  log.Println(t.ModTime())

  if t.HasChangeTime() {
    log.Println(t.ChangeTime())
  }

  if t.HasBirthTime() {
    log.Println(t.BirthTime())
  }
}

Supported Times
------------, windows, linux, solaris, dragonfly, nacl, freebsd, darwin, netbsd, openbsd, plan9, js, :-----:, :-------:, :-----:, :-------:, :---------:, :------:, :-------:, :----:, :------:, :-------:, :-----:, :-----:, atime, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, mtime, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ctime, ✓*, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, ✓, btime, ✓, ✓, ✓, ✓, * Windows XP does not have ChangeTime so HasChangeTime = false,
however Vista onward does have ChangeTime so Timespec.HasChangeTime() will
only return false on those platforms when the syscall used to obtain them fails.

  • Also note, Get(FileInfo) will now only return values available in FileInfo.Sys(), this means Stat() is required to get ChangeTime on Windows

Installation

go get gopkg.in/djherbis/times.v1

主要指標

概覽
名稱與所有者djherbis/times
主編程語言Go
編程語言Go (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-08-29 07:08:15
推送於2023-10-20 15:09:49
最后一次提交2023-10-03 17:12:34
發布數10
最新版本名稱v1.6.0 (發布於 )
第一版名稱v0.9.0 (發布於 )
用户参与
星數271
關注者數6
派生數29
提交數116
已啟用問題?
問題數7
打開的問題數1
拉請求數7
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?