使用perl来判断文件是否存在
发布时间:2020-12-15 23:58:48 所属栏目:大数据 来源:网络整理
导读:使用perl 判断某文件是否存在: #!/usr/bin/perl -wmy $file = "/home/zl/study/perl/fileexist/t.txt";if(-e $file){print "t.txt exist. n";}else{print "do not exist. n";} 判断成功后,可以在继续对文件做其他处理。 参考 :?http://bbs.chinaunix.net
使用perl判断某文件是否存在: #!/usr/bin/perl -w my $file = "/home/zl/study/perl/fileexist/t.txt"; if(-e $file){ print "t.txt exist. n"; }else{ print "do not exist. n"; }判断成功后,可以在继续对文件做其他处理。 参考 :?http://bbs.chinaunix.net/thread-1866833-1-1.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |