Spec-Zone .ru
спецификации, руководства, описания, API
Spec-Zone .ru
спецификации, руководства, описания, API
Библиотека разработчика Mac Разработчик
Поиск

 

Эта страница руководства для  версии 10.9 Mac OS X

Если Вы выполняете различную версию  Mac OS X, просматриваете документацию локально:

Читать страницы руководства

Страницы руководства предназначаются как справочник для людей, уже понимающих технологию.

  • Чтобы изучить, как руководство организовано или узнать о синтаксисе команды, прочитайте страницу руководства для страниц справочника (5).

  • Для получения дополнительной информации об этой технологии, ищите другую документацию в Библиотеке Разработчика Apple.

  • Для получения общей информации о записи сценариев оболочки, считайте Shell, Пишущий сценарий Учебника для начинающих.



File::Listing(3)                     User Contributed Perl Documentation                    File::Listing(3)



NAME
       File::Listing - parse directory listing

SYNOPSIS
        use File::Listing qw(parse_dir);
        $ENV{LANG} = "C";  # dates in non-English locales not supported
        for (parse_dir(`ls -l`)) {
            ($name, $type, $size, $mtime, $mode) = @$_;
            next if $type ne 'f'; # plain file
            #...
        }

        # directory listing can also be read from a file
        open(LISTING, "zcat ls-lR.gz|");
        $dir = parse_dir(\*LISTING, '+0000');

DESCRIPTION
       This module exports a single function called parse_dir(), which can be used to parse directory
       listings.

       The first parameter to parse_dir() is the directory listing to parse.  It can be a scalar, a
       reference to an array of directory lines or a glob representing a filehandle to read the directory
       listing from.

       The second parameter is the time zone to use when parsing time stamps in the listing. If this value
       is undefined, then the local time zone is assumed.

       The third parameter is the type of listing to assume.  Currently supported formats are 'unix',
       'apache' and 'dosftp'.  The default value 'unix'.  Ideally, the listing type should be determined
       automatically.

       The fourth parameter specifies how unparseable lines should be treated.  Values can be 'ignore',
       'warn' or a code reference.  Warn means that the perl warn() function will be called.  If a code
       reference is passed, then this routine will be called and the return value from it will be
       incorporated in the listing.  The default is 'ignore'.

       Only the first parameter is mandatory.

       The return value from parse_dir() is a list of directory entries.  In a scalar context the return
       value is a reference to the list.  The directory entries are represented by an array consisting of [
       $filename, $filetype, $filesize, $filetime, $filemode ].  The $filetype value is one of the letters
       'f', 'd', 'l' or '?'.  The $filetime value is the seconds since Jan 1, 1970.  The $filemode is a
       bitmask like the mode returned by stat().

COPYRIGHT
       Copyright 1996-2010, Gisle Aas

       Based on lsparse.pl (from Lee McLoughlin's ftp mirror package) and Net::FTP's parse_dir (Graham
       Barr).

       This library is free software; you can redistribute it and/or modify it under the same terms as Perl
       itself.



perl v5.12.5                                     2011-09-19                                 File::Listing(3)

Сообщение о проблемах

Способ сообщить о проблеме с этой страницей руководства зависит от типа проблемы:

Ошибки содержания
Ошибки отчета в содержании этой документации к проекту Perl. (См. perlbug (1) для инструкций представления.)
Отчеты об ошибках
Сообщите об ошибках в функциональности описанного инструмента или API к Apple через Генератор отчетов Ошибки и к проекту Perl, использующему perlbug (1).
Форматирование проблем
Отчет, форматирующий ошибки в интерактивной версии этих страниц со ссылками на отзыв ниже.