ITPUB论坛 » Rational » 按时间查找


2008-8-6 21:54 hanfeishu
按时间查找

按时间查找
标题: 按时间查找
详细说明:比如,我在命令行输入2007-07-01,将显示这天所有的信息.
平台:windows
语言要求:perl
其它信息:做成clearcase trigger

已实现情况如下:
#! /usr/bin/env perl -w

use File::stat;

print "Which directory? (Default is your home directory) ";
    chomp(my $dir = <STDIN>);
    if ($dir =~ /^s*$/) {         # A blank line
      chdir or die "Can't chdir to your home directory:
    $!";
    } else {
      chdir $dir or die "Can't chdir to '$dir': $!";
    }
    opendir DOT, "." or die "Can't opendir dot: $!";
    foreach (sort readdir DOT) {
      $sb = stat ($_);
      print scalar localtime $sb->mtime,"        ",$_,"        ","
";
     # next if /^./; ##   if we were skipping dot files
     # print "$_
";
    }

2008-8-6 21:55 juan002
perl 里缺了些组件,用pmp升级一下

页: [1]
查看完整版本: 按时间查找


Powered by ITPUB论坛