[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OpenVZ, VServer и полудесяток



25.12.07, Alex Kuklin<alex@kuklin.ru> написал(а):
> Eugene Berdnikov wrote:
> >> Тикловый glob  - не сортирует.
> >  Перловый, думаю, тоже не сортирует.

perldoc -t -f glob

glob EXPR
[...]
Beginning with v5.6.0, this operator is implemented using the
standard "File::Glob" extension. See File::Glob for details.

man File::Glob
NAME
       File::Glob - Perl extension for BSD glob routine
DESCRIPTION
       File::Glob::bsd_glob() implements the FreeBSD glob(3) routine,
which is a superset of the POSIX glob()

The POSIX defined flags for bsd_glob() are:
[...]
"GLOB_NOSORT"
           By default, the pathnames are sorted in ascending ASCII
order; this flag prevents that sorting (speeding up
           bsd_glob()).


GLOB(P)
The  glob()  function  shall  store  the number of matched pathnames
into pglob->gl_pathc and a pointer to a list of
pointers to pathnames into pglob->gl_pathv. The pathnames shall be in
sort order as defined by the  current  setting
of  the LC_COLLATE category;
[...]
GLOB_NOSORT
              Ordinarily,  glob() sorts the matching pathnames
according to the current setting of the LC_COLLATE category;


Вывод: по умолчанию - сортируют.

Reply to: