亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? filedir_misc.pm

?? 對(duì)文件或目錄的操作函數(shù)模版.根據(jù)對(duì)目錄的分析結(jié)果對(duì)目錄進(jìn)行深度或廣度遍歷從而操作文件(或目錄)
?? PM
字號(hào):
#----------------------------------------------------------------------------
#this is subroutines of file and folder process.
#usage:
#      in your perl file when you want use the following functions, insert
#      ther following string:
#                           require filedir_misc;
#note:
#     the string "require filedir_misc;" only be included once in a file.
#----------------------------------------------------------------------------
require string_misc;

my $OS_Win = ($^O =~ /mswin/i);
my $isCygwin = ($^O =~ /cygwin/i);
my $dirSprtor = $OS_Win? '\\': '/';

# get the current directory which "$0" lies in.
# the return value contains no "/" character at the end of the string.
sub getCurrentDirectory()
{
    my ($lcwd, $cwd) = '';

    eval "\$lcwd = Win32::GetCwd";

    if (!($lcwd eq '' || $lcwd eq 'Win32::GetCwd')) {
        $cwd = $lcwd;
    }
    else {
        chomp($cwd = `pwd`);
    }

    &convetSlash(\$cwd) if ($isCygwin);

    return $cwd;
}

# extentAbsPath()
#    - get aboslute path according relative path.
#
# param0
#    - [in|out]: the relative path when passed in,
#                and absolute path when passed out.
#
sub extentAbsPath(\$)
{
    my ($refPath) = shift;
    my ($temp);

    return 0 if (ref($refPath) ne "SCALAR");

    return $$refPath = &getCurrentDirectory() if ('.' eq $$refPath);
    return $$refPath if ($$refPath =~ m/:/g or $$refPath =~ m/^[\\\/]/);

    $temp = $$refPath;
    $temp =~ s:\/[\w\.]+$::;

    $temp = &getCurrentDirectory() . $dirSprtor . $temp;
    $$refPath = $temp;
}

# getListInDir()
#    - list the dirs and files in the folder.
#
# param0
#   - [out]: reference of a array to store the item list (files and dirs).
# param1
#   - [in]: the dir to be listed.
#
# return
#   - the total count of files and subdirs in this folder.
sub getListInDir(\@$)
{
    my ($refArray, $curDir) = @_;

    die "parameter[0] should be a array!" if (!$refArray);
    die "parameter[1] should be a dir! value==$curDir" if (!$curDir);

    $curDir = $curDir . "/" if ($curDir =~ m /^[A-Za-z]{1}:$/);
    opendir(CURDIR, $curDir) || die "$curDir - $!";

    #remove the "." and  ".." which is short for current fold
    #and parent folder respectively.
    @$refArray = grep(!/^\.\.?$/, readdir(CURDIR));
    closedir(CURDIR);

    return scalar(@$refArray);
}

# param0
#   - [in]: file name or a open file handle.
# param1
#   - [in]: optional param. Mostly this is passed from DirHandler() in order
#           to some alternation determine. For example, we want delete the
#           files in "CVS". So if 1 indicating this file is in the directory
#           'CVS' so delete this file arbitrarily, any other value do nothing
#           on this file.
# param2
#   - [in]: a callback function to be called in this subroutine.
#           By executing this callback the subroutine "handleSingleFile()"
#           makes effect on the file/fileHandle passed from [param1].
sub handleSingleFile($$*)
{
    my ($file, $optionIndicator, $callback) = @_;

    &$callback($file, $optionIndicator) if defined(&$callback);
}

# recursive file system (directory) handler. The detail process can be
# breakdown as following:
#   1: handle the current dir first (if the handler result is 0 then stop
#      recursive handler, otherwise the recursive call will go on.)
#   2: parse the current dir (call the parse callback function).(this is only
#      to pass the parse result to FILE_HANDLER, not recursive intension.)
#   3: handle the files in the current directory according current dir
#      parse result.
#   4: recursive call this handler routine if necessary (according the result
#      returned by step 1).
#
# param0
#   - [in]: directory name which to be handled.
# param1
#   - [in]: directory parse function. $dirHandler(param3) will handle the dir
#           according this callback function's return value. So the return
#           value means:
#               -- positive: this value will be pass to next recursive call
#                   in other words, all subfolder parse value will be ignored
#                   instead using this value.
#               -- negative: (recursive call) subfolder will call $dirParseCB
#                   (param1) to get the value to pass to $dirHandler(param3).
#               -- 0: do nothing on the current directory and no recursive
#                   call is needed.
# param2
#   - [in]: whether the iterate action is width first.
#               0 : depth iterate first.
#               1 : width iterate first.
# param3:
#   - [in]: dir handler. The function prototype likes this:
#           dirHandler($curDir, $dirParseValue).
# param4:
#   - [in]: file handler. The function prototype likes this:
#           fileHandler($curDir, $parentDirParseValue).
# param5:
#   - [in]: This param is optional. If this param is passed by NEGATIVE value
#           that indicates $dirParseCB(param1) is no used.
sub handleSingleDir($*$**;$)
{
    my ($curDir, $dirParseCB, $widthIterate, $dirHandler, $fileHandler,
        $parseInheritable) = @_;
    my ($dirParseValue, @itemList, @dirList, @fileList, $item, $fullFileName);

    die "handleSingleDir() parameter error: dir_handler!\n"
        if (!defined $dirHandler or !$dirHandler);

    &extentAbsPath(\$curDir) unless ($curDir =~ m/^[\\\/]/
                                     or $curDir =~ m/:/g);

    return 0 if (! -d $curDir);

    return 0 if (defined $parseInheritable and 0 == $parseInheritable);

    if (defined $parseInheritable and 0 < $parseInheritable) {
        $dirParseValue = $parseInheritable;
    }
    else {
        if ($dirParseCB) {
            $dirParseValue = &$dirParseCB($curDir);
            return 0 if (0 == $dirParseValue);
        }
        else {
            $dirParseValue = -1;
        }
    }

    if (0 == &getListInDir(\@itemList, $curDir)) {
=here      $dirHandler------------1
=cut
        return &$dirHandler($curDir, $dirParseValue);
    }

    #make the array element ascending.
    @itemList = sort(@itemList);
=here      $dirHandler------------2
=cut
    if ($widthIterate) {
        &$dirHandler($curDir, $dirParseValue);
    }

    foreach $item (@itemList) {
        $fullFileName = "${curDir}${dirSprtor}${item}";

        #width iterate
        if ($widthIterate) {
            #handling file first
            if (-f $fullFileName) {
                &handleSingleFile($fullFileName,
                                  $dirParseValue,
                                  $fileHandler) if ($fileHandler);
            }
            #handling directory
            elsif (-d $fullFileName) {
                #store the subfolder into the @dirList.
                #So a recursive call will be done.
                push(@dirList, $fullFileName);
            }
        }
        #depth iterate
        else {
            #handling file first
            if (-f $fullFileName) {
                #store the files into the @fileList. So if all subdir handle
                #done current file list has chance to handled.
                push(@fileList, $fullFileName);
            }
            #handling directory
            elsif (-d $fullFileName) {
                #store the subfolder into the @dirList.
                #So a recursive call will be done.
                push(@dirList, $fullFileName);
            }
        }
    }

    foreach $item (@dirList) {
        #recursive call
        &handleSingleDir($item,
                         $dirParseCB,
                         $widthIterate,
                         $dirHandler,
                         $fileHandler,
                         $dirParseValue);
    }

    #if there is no fold in the current directory it's time to handle the
    #files stored in the @fileList.
    foreach $item (@fileList) {
        &handleSingleFile($item,
                          $dirParseValue,
                          $fileHandler) if ($fileHandler);
    }

    &$dirHandler($curDir, $dirParseValue) if (!$widthIterate);

    return 1;
}

1;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费观看成人av| 久久影音资源网| 亚洲综合区在线| 日本韩国精品在线| 一区二区三区中文字幕精品精品| 99vv1com这只有精品| 亚洲欧美日韩成人高清在线一区| 色av一区二区| 日韩国产欧美一区二区三区| 欧美一区二区精品在线| 精品一区二区三区免费观看| 国产性色一区二区| 91网上在线视频| 亚洲成人av中文| 欧美www视频| 99久久久精品| 爽爽淫人综合网网站| 日韩三级电影网址| 成人开心网精品视频| 亚洲免费观看视频| 91精品在线观看入口| 国产一区91精品张津瑜| 亚洲欧洲精品一区二区三区不卡 | 欧美福利视频导航| 国内外成人在线| 亚洲欧美日韩一区| 欧美肥胖老妇做爰| 成人黄页毛片网站| 亚洲无人区一区| 国产亚洲精品福利| 欧美日韩小视频| 成人午夜免费av| 婷婷一区二区三区| 中文字幕国产一区| 欧美一区二区三区白人| 成人av在线看| 男人的天堂久久精品| 综合久久久久综合| 精品粉嫩超白一线天av| 色成年激情久久综合| 国产精品一区三区| 天堂一区二区在线| 亚洲柠檬福利资源导航| 26uuu亚洲| 欧美日韩aaa| 成人免费视频app| 精品一区二区三区在线观看国产| 亚洲欧美日韩国产成人精品影院 | 久久亚洲精华国产精华液| 91麻豆国产福利精品| 国产一区在线精品| 青青草成人在线观看| 亚洲激情六月丁香| 亚洲女与黑人做爰| 欧美激情综合在线| 久久这里只有精品首页| 欧美精品丝袜中出| 欧美性猛片aaaaaaa做受| 成人久久视频在线观看| 国产精品亚洲专一区二区三区| 日本少妇一区二区| 天堂va蜜桃一区二区三区漫画版| 亚洲日本中文字幕区| 中文字幕精品在线不卡| 久久久一区二区三区捆绑**| 制服丝袜亚洲精品中文字幕| 日本二三区不卡| 色综合久久久久综合| 成人夜色视频网站在线观看| 韩日欧美一区二区三区| 久久精品国产精品亚洲综合| 日韩在线观看一区二区| 天天av天天翘天天综合网| 亚洲一区二区在线视频| 一区二区三区国产精华| 亚洲精品高清在线| 亚洲综合在线电影| 亚洲一区二区三区视频在线| 亚洲一区二区在线观看视频| 亚洲精品日日夜夜| 亚洲黄色录像片| 亚洲日本丝袜连裤袜办公室| 国产精品国产三级国产有无不卡| 国产精品你懂的在线| 国产精品免费av| 国产精品毛片无遮挡高清| 中文字幕免费一区| 日韩久久一区二区| 亚洲最大的成人av| 亚洲成人免费电影| 男人的天堂久久精品| 激情小说欧美图片| 成人免费av资源| 色视频一区二区| 欧美一卡二卡在线观看| 欧美va亚洲va| 中文av字幕一区| 亚洲精品日产精品乱码不卡| 五月天一区二区| 精品一区二区三区免费观看| 大桥未久av一区二区三区中文| 99国产精品久久久久久久久久| 色偷偷88欧美精品久久久| 欧美精品一卡二卡| 亚洲精品中文在线影院| 一区二区三区成人| 看电影不卡的网站| 99久久精品免费| 欧美人妇做爰xxxⅹ性高电影| 日韩视频免费直播| 国产精品久线观看视频| 亚洲国产色一区| 国产一二精品视频| 一本久道中文字幕精品亚洲嫩| 欧美老肥妇做.爰bbww| 久久综合九色综合欧美就去吻| 中文字幕五月欧美| 男女性色大片免费观看一区二区 | 制服丝袜国产精品| 国产亚洲制服色| 亚洲成人先锋电影| 国产99久久久国产精品免费看| 91丨九色porny丨蝌蚪| 日韩亚洲欧美一区二区三区| 国产精品美女视频| 免费成人在线网站| 色综合天天综合网国产成人综合天 | 国产精品久久久久久久久动漫| 亚洲一区二区3| 福利一区二区在线观看| 欧美精品久久久久久久久老牛影院| 国产欧美日韩激情| 免费观看一级特黄欧美大片| 在线一区二区三区做爰视频网站| 精品久久久久久久人人人人传媒| 一区二区三区国产精华| 国产99精品国产| 日韩欧美国产电影| 午夜精品久久一牛影视| av电影在线不卡| 久久久亚洲精品石原莉奈| 天堂一区二区在线免费观看| 91麻豆蜜桃一区二区三区| 2021中文字幕一区亚洲| 日韩精品乱码免费| 日本韩国欧美国产| 中文字幕日本不卡| 国产精品白丝jk白祙喷水网站| 欧美一二三四在线| 亚洲成人免费视频| 在线观看欧美日本| 亚洲啪啪综合av一区二区三区| 国产精品自在在线| 2021国产精品久久精品| 美女视频黄久久| 欧美一区二区三区四区五区| 亚洲国产一区二区a毛片| 91久久精品国产91性色tv| 国产欧美日韩精品一区| 狠狠色丁香久久婷婷综合_中| 日韩午夜激情电影| 日本sm残虐另类| 欧美一区二区三区免费在线看| 视频一区欧美精品| 7777精品伊人久久久大香线蕉完整版| 亚洲国产精品麻豆| 欧美日韩国产色站一区二区三区| 亚洲一二三四在线观看| av在线不卡电影| 欧美在线免费播放| 国产日产欧美一区二区三区| 成人av免费网站| 国产精品高潮呻吟| 91在线视频18| 亚洲最新视频在线观看| 在线精品视频一区二区三四| 亚洲国产成人porn| 777欧美精品| 国内不卡的二区三区中文字幕| 久久青草欧美一区二区三区| 国产成人亚洲精品青草天美| 久久久久久久久久久黄色| 成人晚上爱看视频| 亚洲欧美日韩在线播放| 欧美日韩你懂的| 免费观看一级欧美片| 久久久久久久久久久久久久久99| 国产99久久久国产精品潘金| 亚洲视频免费在线| 欧美久久久久中文字幕| 麻豆久久久久久| 中文字幕成人av| 欧美午夜精品久久久久久孕妇| 秋霞午夜鲁丝一区二区老狼| 久久婷婷成人综合色| 91最新地址在线播放| 日本视频一区二区| 国产精品无码永久免费888| 在线观看亚洲成人| 极品销魂美女一区二区三区|