-
-
Notifications
You must be signed in to change notification settings - Fork 764
Include milliseconds when sorting by time #978
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
Comments
struct stat {
...
/* Since Linux 2.6, the kernel supports nanosecond
precision for the following timestamp fields.
For the details before Linux 2.6, see NOTES. */
struct timespec st_atim; /* Time of last access */
struct timespec st_mtim; /* Time of last modification */
struct timespec st_ctim; /* Time of last status change */
...
}; The time comparison is done in 2513 if (cfg.timeorder) {
2514 if (pb->t > pa->t)
2515 return 1;
2516 if (pb->t < pa->t)
2517 return -1;
2518 } Note that |
I don't understand. Then why does |
I don't know why you are seeing this. I checked in /bin and saw the order is same for |
Confirm that you are not using sessions and it's retained. Check your My locale:
My
|
Ran without sessions, same thing. Recompiled without my arrow patch and without compilation options, same thing. /bin is located on a drive using XFS and the original files I discovered this problem with are on another drive using BTRFS. My locale:
My
|
And what are the program options you use to start |
I can reproduce this with the following script: #!/bin/bash
today=$( date +%Y%m%d ) # or: printf -v today '%(%Y%m%d)T' -1
number=0
fname=$today.txt
while [ "$number" -le 20 ]; do
printf -v fname '%s-%02d.txt' "$today" "$(( ++number ))"
touch "$fname"
done |
Linux Kernel 5.11.10
nnn v4.0
BTRFS
Long story short, I was trying to get
sxiv
to order pictures in the same waynnn
presents them from newest to oldest. These are hundreds of images downloaded within seconds usingwget2
. I thinknnn
ignores milliseconds when sorting by time, and therefore is unable to match the order of something likels --full-time -t
.For example, here is a list of milliseconds printed in the exact order
nnn
presents files from newest to oldest.Now here is the correct order if the files are supposed to be newest to oldest.
The text was updated successfully, but these errors were encountered: