edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] Directory Sort
@ 2018-01-13 17:31 Karl Dahlke
  2018-01-13 17:42 ` Dominique Martinet
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Dahlke @ 2018-01-13 17:31 UTC (permalink / raw)
  To: Edbrowse-dev

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Edbrowse-dev] Directory Sort
  2018-01-13 17:31 [Edbrowse-dev] Directory Sort Karl Dahlke
@ 2018-01-13 17:42 ` Dominique Martinet
  2018-01-13 17:56   ` Karl Dahlke
  0 siblings, 1 reply; 3+ messages in thread
From: Dominique Martinet @ 2018-01-13 17:42 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev



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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Edbrowse-dev] Directory Sort
  2018-01-13 17:42 ` Dominique Martinet
@ 2018-01-13 17:56   ` Karl Dahlke
  0 siblings, 0 replies; 3+ messages in thread
From: Karl Dahlke @ 2018-01-13 17:56 UTC (permalink / raw)
  To: Edbrowse-dev

[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-13 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-13 17:31 [Edbrowse-dev] Directory Sort Karl Dahlke
2018-01-13 17:42 ` Dominique Martinet
2018-01-13 17:56   ` Karl Dahlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).