文件操作符|-e|-M|-s|-A|_|-r -w $filename|stat|localtime|&|>>|<<
2024-10-08 18:16:06
TTY:终端是一种字符型设备,它有多种类型,通常使用tty 来简称各种类型的终端设备
#!/usr/bin/perl use strict;
use warnings; print "exist!\n" if -e '1.txt';
print "exist!\n" if -e '2.txt'; #exist!
# warn "new file!\n" if -M '1.txt' < ; #new file! my $filename = '1.txt';
if((-s $filename <100_000) &&(-A _ < )){print "this file is small and new!\n";}
if(-w -r _ ){print "this file is both writable and readable!\n";} #this file is small and new!
#this file is both writable and readable! my $file = -s $filename;print "file size is $file"."B\n"; #file size is 116B if (-l 'check.pl'){print "check.pl is a file with link\n"} #check.pl is a file with link my $M = -M '1.txt';my $C = -C 'check.pl';my $A = -A 'check.pl';print "$M\t$C\t$A\n"; #0.0313657407407407407 3.10847222222222222 3.10847222222222222 $_ ='1.txt';if (-r){print "$_ is a readhandle\n"} #1.txt is a readhandle my $size = (-s)/;print "$size\n"; #0.11328125 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat('1.txt');$atime = localtime $atime;
my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=localtime $ctime;
print "dev_number=$dev\ninode =$ino\nmode=$mode\nhard link=$nlink\nuser id=$uid\ngroup id=$gid\n$rdev\nsize=$size\n$atime\n$mtime\n$ctime\n$blksize\n$blocks\n";
print "$yday\n"; #dev_number=43
#inode =95085688861
#mode=33188
#hard link=1
#user id=1000092
#group id=30086
#0
#size=116
#Sun Jun 30 17:17:20 2019
#1561886240
#1561886240
#1048576
#8
#180 my $now =gmtime;print "$now\n"; #Sun Jun 30 11:10:25 2019 my $two = &;print "$two\n";
my $move = 25.5>>;print "$move\n";
$move = (>>)<<;print "$move\n"; #0
#6
#24
最新文章
- 使用静态函数impl模式做接口
- ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
- Notepad++ 配置 Node.js 开发环境
- Bash 的 no-fork 优化
- asp.net 站点重启
- oracle job有定时执行的功能,可以在指定的时间点或每天的某个时间点自行执行任务。
- php单例模式的研究
- JNI Local Reference Changes in ICS
- Undokumentierte @Formeln/LotusScript im Lotus Notes Client/Server
- Spring中使用Jcaptcha实现校验码验证
- C语言每日一题之No.3
- 怎样在Android中ListView与ArrayAdapter配合使用
- JavaScript DOM实战:创建和克隆元素
- mysql编码详解
- 如何实例化i2c_client(四法)
- Sublime 插件安装
- 201521123087 《Java程序设计》第5周学习总结
- [css 揭秘]:CSS揭秘 技巧(四):边框内圆角
- api签名认证方案
- elasticsearch安装之各种坑