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

There seems to be swapped file's accessed and created values on Linux #2624

Closed
Oldes opened this issue Sep 27, 2024 · 2 comments
Closed

There seems to be swapped file's accessed and created values on Linux #2624

Oldes opened this issue Sep 27, 2024 · 2 comments

Comments

@Oldes
Copy link
Owner

Oldes commented Sep 27, 2024

It can be demonstrated with this test in a console:

>> write %aaa "aaa"
== %aaa

>> query %aaa [created: accessed:]
== [
    created: 27-Sep-2024/16:16:47+2:00
    accessed: 27-Sep-2024/16:16:47+2:00
]

>> write/append %aaa "aaa"
== %aaa

>> query %aaa [created: accessed:]
== [
    created: 27-Sep-2024/16:17:02+2:00  ;<-- modified value
    accessed: 27-Sep-2024/16:16:47+2:00 ;<-- unchanged value
]

On Windows it is ok.

@Oldes
Copy link
Owner Author

Oldes commented Sep 27, 2024

The reason is, that used st_ctime on Linux does not mean created, but changed (e.g., changing permissions)!

To get a file creation time one must use statx system call (requires Linux kernel 4.11 or later) instead of plain stat.

@Oldes
Copy link
Owner Author

Oldes commented Sep 27, 2024

Oldes added a commit to Oldes/Rebol3 that referenced this issue Oct 1, 2024
…and resolved correct creation time on Linux (when possible)

resolves: Oldes/Rebol-issues#2626
related to: Oldes/Rebol-issues#2624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant