File::DirListの使い方。
ディレクトリに含まれるファイルリストを返す。
SYNOPSIS
use File::DirList; # my @list = File::DirList::list('.', 'dn', 1, 0);
DESCRIPTION
このモジュールは2つのメソッドを持つ。
list($dirName, $sortMode, $noLinks, $hideDotFiles, $showSelf)
指定したディレクトリに含まれるファイルのリストを返す。
- $dirName : ディレクトリ名
- $sortMode : ソートモード
- d or D
- "Directory" sort. 'd' means all the directories will precede files, 'D' means revese.
- n or N
- Sort by file (or subdir) name. 'n' means strate, 'N' means revese
- i or I
- Same as 'n' but case insesitive
- m or M
- Sort by modification time, strate or revese
- c or C
- Sort by creation time, strate or revese
- a or A
- Sort by access time, strate or revese
- s or S
- Sort by access time, strate or revese
- $noLinks
If true symbolic links will not be examined. Set it on the platforms without symlink support.
- $hideDotFiles
If true 'dot' files will not be reported.
- $showSelf
If true '.' directory entry will be reported.
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)
list()により作られたリストを再ソートする。
ソートされたリストを返す。
- $lis
Reference to a list produced by list()
- $sortMode
Sorting rules.