安裝Test 模組
#cpan -i Test
Test模組能處理的檔案屬性(attribute)請參考
http://www.cs.cf.ac.uk/Dave/PERL/node69.html
我寫一個測試用的script 來說明
#!/bin/perl
#檢查/tmp/abc.txt 是否為空檔
#執行前先要有要測試的檔案 ex:/tmp/abc.txt
use Test;
if ( -s "/tmp/abc.txt" )
{
    print " file size more then 0 \n";

}
else
{
    print "file size is 0\n";
}

 


arrow
arrow
    全站熱搜

    yuanann 發表在 痞客邦 留言(0) 人氣()