Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: suggestion for new glob modifiers



Sven sent me this and suggested I forwarded it to the list...


Peter Stephenson wrote:

> ...
> 
> One minor question is whether (Om) etc. should really be oldest first.
> I can see that's logical --- `time order' certainly implies oldest
> first --- but unfortunately it's the other way round from ls -t, which
> is the order I've grown to expect.  I can easily get used to using ^,
> though.

Funny, I was worrying about this, too, and for the same reason
(comparison with `ls -t'). Maybe it's better to change it.

Bye
 Sven

*** os/glob.c	Mon Jan 25 12:07:41 1999
--- Src/glob.c	Mon Jan 25 14:22:09 1999
***************
*** 1038,1050 ****
  	    r = b->size - a->size;
  	    break;
  	case GS_ATIME:
! 	    r = b->atime - a->atime;
  	    break;
  	case GS_MTIME:
! 	    r = b->mtime - a->mtime;
  	    break;
  	case GS_CTIME:
! 	    r = b->ctime - a->ctime;
  	    break;
  	case GS_LINKS:
  	    r = b->links - a->links;
--- 1038,1050 ----
  	    r = b->size - a->size;
  	    break;
  	case GS_ATIME:
! 	    r = a->atime - b->atime;
  	    break;
  	case GS_MTIME:
! 	    r = a->mtime - b->mtime;
  	    break;
  	case GS_CTIME:
! 	    r = a->ctime - b->ctime;
  	    break;
  	case GS_LINKS:
  	    r = b->links - a->links;
***************
*** 1053,1065 ****
  	    r = b->_size - a->_size;
  	    break;
  	case GS__ATIME:
! 	    r = b->_atime - a->_atime;
  	    break;
  	case GS__MTIME:
! 	    r = b->_mtime - a->_mtime;
  	    break;
  	case GS__CTIME:
! 	    r = b->_ctime - a->_ctime;
  	    break;
  	case GS__LINKS:
  	    r = b->_links - a->_links;
--- 1053,1065 ----
  	    r = b->_size - a->_size;
  	    break;
  	case GS__ATIME:
! 	    r = a->_atime - b->_atime;
  	    break;
  	case GS__MTIME:
! 	    r = a->_mtime - b->_mtime;
  	    break;
  	case GS__CTIME:
! 	    r = a->_ctime - b->_ctime;
  	    break;
  	case GS__LINKS:
  	    r = b->_links - a->_links;
*** od/Zsh/expn.yo	Mon Jan 25 12:07:48 1999
--- Doc/Zsh/expn.yo	Mon Jan 25 14:24:33 1999
***************
*** 1128,1134 ****
  are sorted depending on the size (length) of the files, tt(l) makes
  them be sorted by the number of links, and tt(a), tt(m), and tt(c)
  make them be sorted by the time of the last access, modification, and
! inode change respectively. Note that the modifiers tt(^) and tt(-) are 
  used, so `tt(*(^-OL))' gives a list of all files sorted by file size in 
  descending order working not on symbolic links but on the files they
  point to.
--- 1128,1136 ----
  are sorted depending on the size (length) of the files, tt(l) makes
  them be sorted by the number of links, and tt(a), tt(m), and tt(c)
  make them be sorted by the time of the last access, modification, and
! inode change respectively. Note that tt(a), tt(m), and tt(c) compare
! the age with to the current time, so the first name in the list is the 
! one of the youngest file. Also note that the modifiers tt(^) and tt(-) are 
  used, so `tt(*(^-OL))' gives a list of all files sorted by file size in 
  descending order working not on symbolic links but on the files they
  point to.

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author