Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

jftuga/gostat

Repository files navigation

gostat

display and set file timestamps

For more information on Birth Time, Modify Time, Access Time, and Create Time, please see the Wikipedia article on MAC times.

Binaries for Windows, MacOS, and Linux are provided on the Releases page.

Usage

Usage: gostat [OPTION]... [FILE]...
Display and set file time stamps

  -a string
    	set file access time, format: YYYYMMDD.HHMMSS
  -b string
    	set both access and modify time, format: YYYYMMDD.HHMMSS
  -m string
    	set file modify time, format: YYYYMMDD.HHMMSS
  -v	show program version and then exit

Example - display times

PS C:\github.com\jftuga\gostat> .\gostat.exe go.*

name  : go.mod
size  : 84
btime : 2021-03-29 10:31:20.7843427 -0400 EDT
ctime : 2021-03-29 10:31:28.8303228 -0400 EDT
mtime : 2021-03-29 10:31:28.8303228 -0400 EDT
atime : 2021-03-29 10:31:28.8303228 -0400 EDT

name  : go.sum
size  : 171
btime : 2021-03-29 10:31:28.8347262 -0400 EDT
ctime : 2021-03-29 10:31:28.8347262 -0400 EDT
mtime : 2021-03-29 10:31:28.8347262 -0400 EDT
atime : 2021-03-29 10:31:28.8347262 -0400 EDT

Example - change access time

PS C:\github.com\jftuga\gostat> .\gostat.exe -a 20210329.090807 .\README.md
name  : .\README.md
size  : 43
btime : 2021-03-29 08:16:26.7001842 -0400 EDT
ctime : 2021-03-29 10:55:21.2762476 -0400 EDT
mtime : 2021-03-29 08:16:26.7001842 -0400 EDT
atime : 2021-03-29 09:08:07 -0400 EDT

Development

Building

go build -ldflags="-s -w"

Testing with Coverage

go test -v -cover

About

display and set file timestamps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages