[-- Attachment #1: Type: text/plain, Size: 1871 bytes --] I implemented this because I wanted it, but I didn't document it, because I'm not sure if you like this interface, or if we might change it. Pull the latest and play around. This is a way to sort your entries in directory mode in ways other than alphabetical. It's only meaningful when reading in a directory. I hardly ever need it, but when I need it, I need it! Remember the various ls commands? lsl shows you the length of the file on the current line. lst time lss size lsy symbolic link lsp permissions lsi inode lsk link count lsm major minor numbers. To put this on all the files in the scan, enter ls=lt, or some such, then read in the directory. The equals sign puts it on all files in the directory listing. All this was there before. I'm trying to keep a similar syntax with the new stuff. dsrt=a sort alphabetical. dsrt=t sort by time. dsrt=s sort by size. With help messages on you'll see the sort mode as you set it. You can also use + as in dsrt+a. This is intuitive, with dsrt-a for reverse sort alphabetical. dsrt-t reverse sort time, dsrt-s reverse sort size. They can be effective together. If you care about the times of your files, and you want them sorted that way, dsrt-t ls=t e some_directory If you are already in a directory and want to change the sort or display, make the changes and then refresh with rf. so: did I break anything? Does the new sort work as expected? Would you change anything as to how it works, or the user interface? I use qsort so it should be fast even for huge directories, though it does have to stat each inode. Finally, when sorting by time or size, should I move all the directories and special files to the end? They don't really have any meaning in terms of mod time or file size. I don't do that now but thinking maybe I should, what do you think? Karl Dahlke
I don't really use edbrowse for files, but a couple of remarks as I do use ls sorting a lot. Karl Dahlke wrote on Sat, Jan 13, 2018: > dsrt=t sort by time. Files have three (or sometimes four now) times, the time you're referring to is probably mtime (modification time), but I think it might be useful to also sort by atime (access time) occasionally. I use that, for example, when listening to a long list of files ; if I have to resume from wherever I left on the previous day I just sort by access time and pick the oldest one as that usually is how they happen to be sorted : things I have accessed on the previous days are more recent, and I usually write files in order too so the old ones will be in order as well either from previous listening or creation. The other two times are ctime (change time) and crtime (creation time), although crtime is not always accessible, and I have found no use for these on a daily basis. > Finally, when sorting by time or size, should I move all the > directories and special files to the end? > They don't really have any meaning in terms of mod time or file size. > I don't do that now but thinking maybe I should, what do you think? I would not, but I assume that is just how I am used to it; For example, when I list my download directory in order for the most recent things if the recent thing was a tarball I extracted I want the corresponding directory listed with the tarball. There might be uses to sorting directories separately. Making it yet another option might be overkill, I don't know. -- Dominique
[-- Attachment #1: Type: text/plain, Size: 441 bytes --] Ok, maybe time on directories makes sense. It doesn't on special files, but pretty rare for special files to be in your directories anyways, so I guess I won't worry about it. Yes access time would be nice, but the ls commands don't know about that either. I'd need a new lsa or something. And also the corresponding sort. But unless people want it, and would use it, I'm not gonna bother with it. I wouldn't use it. Karl Dahlke