文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>ftp内部文件搜索(一)……遍历并导出

ftp内部文件搜索(一)……遍历并导出

时间:2007-03-30  来源:1jjk

#!/usr/bin/perl -W
#
# File: output.pl
# Author: 1jjk

#mail:[email protected]
# License: GPL-2
use strict;
use warnings;
use File::Find;

 

print "finding now ,please wait..........\n";
my ($size, $dircnt, $filecnt) = (0, 0, 0);
open(II,">>qq.txt");
sub process {
    my $file = $File::Find::name;
    print II $file,"\n";
    if (-d $file) {
        $dircnt++;
    }
    else {
        $filecnt++;
        $size += -s $file;
    }
}

find(\&process , '/ftp');
print "$filecnt files, $dircnt directory. $size bytes.\n";
close(II);

 

[root@ljjk root]# perl a.pl
finding now ,please wait..........
然后会生成一个qq.txt文件

内容就不全发出来了,太多了,呵呵!!

 

参考文章,在ChinaUnix的perl版!

相关阅读 更多 +
排行榜 更多 +
方块枪战战场安卓版

方块枪战战场安卓版

飞行射击 下载
战斗火力射击安卓版

战斗火力射击安卓版

飞行射击 下载
空中防御战安卓版

空中防御战安卓版

飞行射击 下载