os.Path.dirsort

Defines the sort criteria and sort order for os.Path.diropen().

Syntax

os.Path.dirsort(
   criteria STRING,
   order INTEGER )
  1. criteria is the sort criteria.
  2. order defines ascending (1) or descending (-1) order.

Usage

When you call this function, you define the sort criteria and sort order for any subsequent os.Path.diropen() call.

The criteria parameter must be one of the following strings:

When sorting by name, directory entries will be ordered according to the current locale.

When sorting by any criteria other than the file name, entries having the same value for the given criteria are ordered by name following the value of the order parameter.