argra****@users*****
argra****@users*****
2010年 10月 21日 (木) 04:56:20 JST
Index: docs/modules/libwww-perl-5.813/File/Listing.pod diff -u /dev/null docs/modules/libwww-perl-5.813/File/Listing.pod:1.1 --- /dev/null Thu Oct 21 04:56:20 2010 +++ docs/modules/libwww-perl-5.813/File/Listing.pod Thu Oct 21 04:56:20 2010 @@ -0,0 +1,150 @@ + +=encoding euc-jp + +=head1 NAME + +=begin original + +File::Listing - parse directory listing + +=end original + +File::Listing - ディレクトリ一覧をパースする + +=head1 SYNOPSIS + + use File::Listing qw(parse_dir); + 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'); + +=head1 DESCRIPTION + +=begin original + +This module exports a single function called parse_dir(), which can be +used to parse directory listings. Currently it only understand Unix +C<'ls -l'> and C<'ls -lR'> format. It should eventually be able to +most things you might get back from a ftp server file listing (LIST +command), i.e. VMS listings, NT listings, DOS listings,... + +=end original + +This module exports a single function called parse_dir(), which can be +used to parse directory listings. Currently it only understand Unix +C<'ls -l'> and C<'ls -lR'> format. It should eventually be able to +most things you might get back from a ftp server file listing (LIST +command), i.e. VMS listings, NT listings, DOS listings,... +(TBT) + +=begin original + +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. + +=end original + +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. +(TBT) + +=begin original + +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. + +=end original + +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. +(TBT) + +=begin original + +The third parameter is the type of listing to assume. The values will +be strings like 'unix', 'vms', 'dos'. Currently only 'unix' is +implemented and this is also the default value. Ideally, the listing +type should be determined automatically. + +=end original + +The third parameter is the type of listing to assume. The values will +be strings like 'unix', 'vms', 'dos'. Currently only 'unix' is +implemented and this is also the default value. Ideally, the listing +type should be determined automatically. +(TBT) + +=begin original + +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'. + +=end original + +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'. +(TBT) + +=begin original + +Only the first parameter is mandatory. + +=end original + +最初のパラメータのみが必須です。 + +=begin original + +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(). + +=end original + +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(). +(TBT) + +=head1 CREDITS + +=begin original + +Based on lsparse.pl (from Lee McLoughlin's ftp mirror package) and +Net::FTP's parse_dir (Graham Barr). + +=end original + +(Lee McLoughlin による ftp mirror パッケージの) lsparse.pl と、 +(Graham Barr による) Net::FTP の parse_dir を基にしています。 + +=begin meta + +Translated: Kentaro SHIRAKATA <argra****@ub32*****> (5.813) + +=end meta +