Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: Stat() offers mtime but not atime #58379

Closed
lfaoro opened this issue Feb 7, 2023 · 2 comments
Closed

os: Stat() offers mtime but not atime #58379

lfaoro opened this issue Feb 7, 2023 · 2 comments

Comments

@lfaoro
Copy link

lfaoro commented Feb 7, 2023

Screenshot

image

What did you do?

used os.Stat() to retrieve data about a file

What did you expect to see?

two methods:

  • ModTime() / MTime()
  • AccTime() / ATime()

What did you see instead?

only .ModTime()

I wonder why os.Stat() doesn't offer atime and if you guys know another way to retrieve this data.
ever if there's another way to get this data, would you consider making it available via os.Stat()?

@lfaoro lfaoro added the pkgsite label Feb 7, 2023
@mateusz834
Copy link
Member

The os package only supports ModTime, for other you need to use syscalls (stat, statx) directly or use a third-party package (like: github.com/djherbis/times)

@seankhliao seankhliao removed the pkgsite label Feb 7, 2023
@seankhliao
Copy link
Member

Duplicate of #3952

@seankhliao seankhliao marked this as a duplicate of #3952 Feb 7, 2023
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2023
@golang golang locked and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants