fix!: introduce a new btime
term to align ctime
with Unix
#1761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1760
This is a tricky issue. The initial introduction of
ctime
was just to correspond with the "created time" in Rust:yazi/yazi-shared/src/fs/cha.rs
Line 46 in 558d97d
which isn't a problem on non-Unix platforms.
However, in Unix,
ctime
has a different meaning — it refers to "changed time" which indicates when file attributes changed, yet it's distinct frommtime
("modified time") which indicates when file content is modified.This PR attempts to address the issue fundamentally by aligning with Unix. This way, Yazi behaves correctly on Unix platforms, while also being fine on non-Unix platforms since they don't have the concept of
ctime
at all, and then we'll always usebtime
to represent a file's "created time", i.e. "birth time".Renamed
created
tobtime
,modified
tomtime
for thesort_by
optionRenamed
ctime
tobtime
for thelinemode
commandRenamed
created
tobtime
,modified
tomtime
for thesort
commandRenamed the
created
,modified
,accessed
,length
, andpermissions
properties of theCha
created
=>btime
modified
=>mtime
accessed
=>atime
length
=>len
permissions
=>perm
Note that the old names are still available, but a deprecation warning will shown — they will be completely removed in the next major version 0.4.2.