文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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版!

相关阅读 更多 +
排行榜 更多 +
声控忍者安卓版

声控忍者安卓版

冒险解谜 下载
Zombies Bang

Zombies Bang

冒险解谜 下载
海绵邻居5个朋友版

海绵邻居5个朋友版

冒险解谜 下载