
File::DirList - provide a sorted list of directory content
Version 0.04

use File::DirList;
#
my @list = File::DirList::list('.', 'dn', 1, 0);

This module is used to get list of directory content. Simple wrapper around DirHandle and sort()
Module have a 2 methods
list($dirName, $sortMode, $noLinks, $hideDotFiles, $showSelf)Producind a list, accepting 5 parameters:
$dirNameName of the directory to list
$sortModeDescribes how list should be sorted.
This is a string contains the following symbols
d or D"Directory" sort. 'd' means all the directories will precede files, 'D' means revese.
n or NSort by file (or subdir) name. 'n' means strate, 'N' means revese
i or ISame as 'n' but case insesitive
m or MSort by modification time, strate or revese
c or CSort by creation time, strate or revese
a or ASort by access time, strate or revese
s or SSort by access time, strate or revese
$sortMode is interpreted from left to right. In case first comparation produce equal result next one is used. For example, string 'din' produce a list with all the directories preceding files, directories and files are sorted by name case insensitive, but low case letter preceeding upper case.
$noLinksIf true symbolic links will not be examined. Set it on the platforms without symlink support.
$hideDotFilesIf true 'dot' files will not be reported.
$showSelfIf true '.' directory entry will be reported.
Returned value is a refference for array sorted as described by $sortMode.
Array elemnts are refferences to another arrays representing an item.
Item array contains 17 elements:
[0..12]Result of stat() for this item. For valid symbolik links stat of the target item is returned.
[13]Name of the item.
[14]Is item a directory? Contains 0 for non-directory items, 1 for directories, 2 for '..', 3 for '.'. Used by "d or D" sorting.
[15]Is item a link? 0 for non-links, 1 for valid links, -1 for invalid links.
[16]Link target. undef for non-links, target path for links.
[15] and [16] are set to non-link if $examineLinks is false.
sortList($list, $sortMode)Used to re-sort a list produced by list()
Parameters are
Returning value is similar to list()
None by default


Daniel Podolsky, <tpaba@cpan.org>

Copyright (C) 2006 by Daniel Podolsky, <tpaba@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.