rsync sort list

Wayne Davison wayned at samba.org
Sun Feb 4 23:38:58 GMT 2007


On Sun, Feb 04, 2007 at 06:47:57PM +0200, catam wrote:
> shouldnt dir a came before a-c ?

Directories have an assumed trailing slash on the end of their name for
the purposes of sorting, which is why a-c/ comes before a/.  The reason
for this is that older versions of rsync used to sort files from inside
a subdirectory into strange places sometimes (instead of right after
the subdir).  For instance:

  a
  a-c
  a-c/bar
  a/foo

In a modern rsync, this is now:

  a-c/
  a-c/bar
  a/
  a/foo

An alternative solution would have been to sort any '/' char
alphabetically prior to all other non-slash characters, but that
is not the solution I chose way back when.

..wayne..


More information about the rsync mailing list