文件操作符|-e|-M|-s|-A|_|-r -w $filename|stat|localtime|&|>>|<<
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
文件操作符|-e|-M|-s|-A|_|-r -w $filename|stat|localtime|&|>>|<<的更多相关文章
- C#读写文件的方法汇总_C#教程_脚本之家
C#读写文件的方法汇总_C#教程_脚本之家 http://www.jb51.net/article/34936.htm
- 你绝对想不到R文件找不到(cannot resolve symbol R)的原因
你绝对想不到R文件找不到(cannot resolve symbol R)的原因 最近在项目开发中 Android Studio 的 R 文件突然找不到了.IDE 中出现了以下提示 cannot re ...
- python IOError: invalid mode ('r') or filename
我想要用pandas.read_table()将数据表中的数据读到一个pandas DataFrame对象中: import pandas as pd unames = ['user_id', 'ge ...
- Python报错IOError: [Errno 22] invalid mode ('r') or filename
IOError: [Errno 22] invalid mode ('r') or filename: 这种错误的出现是在使用built-in函数file()或者open()的时候. 或者是因为文件的 ...
- Android开发_*.R文件无法自动生成
问题描述: 今天是我决定专注Android开发的第一天,我在网上下载了一个数独游戏的源码,准备开始着手学习.在导入之后出现Java文件中import *.R文件报错,在gen目 ...
- c语言_文件操作_FILE结构体解释_涉及对操作系统文件FCB操作的解释_
1. 文件和流的关系 C将每个文件简单地作为顺序字节流(如下图).每个文件用文件结束符结束,或者在特定字节数的地方结束,这个特定的字节数可以存储在系统维护的管理数据结构中.当打开文件时,就建立了和文件 ...
- Python文件读写之r+/w+/a+
读模式 r 打开不存在的文件会报错.不能写:如不指定模式则默认是r 写模式 w 打开不存在的文件会,会新建一个文件:打开存在的文件会先清空后覆盖原有文件:不能读 追加模式 a 打开不存在的文件会,会新 ...
- 第3章 文件I/O(8)_贯穿案例:构建标准IO函数库
9. 贯穿案例:构建标准IO函数库 //mstdio.h #ifndef __MSTDIO_H__ #define __MSTDIO_H__ #include <unistd.h> #de ...
- python文件操作各种模式和常用方法总结r r+ rb r+b
1.读,r r+ rb r+b read() 全部读取 read(n) 读取一部分 r模式下:n 个字符. rb模式下:n个 字节. readline() 按行读取. readlines() 返回个列 ...
随机推荐
- MVC学生管理系统-阶段IV(修改学生信息)
项目源码 :https://download.csdn.net/download/weixin_44718300/11091042 前期准备,主体框架, 学生列表显示 请看阶段一文章 添加学生信息 ...
- UVALive 4731 dp+贪心
这个题首先要利用题目的特性,先贪心,否则无法进行DP 因为求期望的话,越后面的乘的越大,所以为了得到最小值,应该把概率值降序排序,把大的数跟小的系数相乘 然后这种dp的特性就是转移的时候,由 i推到i ...
- 实验吧web-易-上传绕过
随便上传一个png文件,出现提示 我们再上传一个php文件,却出现提示 上传遇到问题是肯定的,题目就是上传绕过,所以我们下面要做的就是绕过检测. 这里使用00截断. 首先在提交时抓包 我们将图中upl ...
- 关于fdisk命令
fdisk命令用于观察硬盘实体使用情况,也可对硬盘分区. [root@loclhost ~]# fdisk /dev/sdb Command (m for help): m #输入m列出常用的命令 C ...
- @SpringBootApplication-exclude和扫描并装配其他包下的bean(@AliasFor)
1.exclude 不装配指定bean @SpringBootApplication(exclude={com.ebc.User.class}) 2.scanBasePackages package ...
- 51nod 1346:递归
1346 递归 基准时间限制:1 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 收藏 关注 函数f(n,m) { 若n=1或m=1返回a[n][m]; 返回f(n-1,m)异或 ...
- BZOJ 4084 [Sdoi2015]双旋转字符串
题解:hash 至今不会unsigned long long 的输出 把B扔进map 找A[mid+1][lenA]在A[1][mid]中的位置 把A[1][mid]贴两遍(套路) 枚举A[mid+1 ...
- CSS3 box-shadow 效果大全(内阴影,外阴影,三边阴影,双边阴影,单边阴影,细线描边…)
/* offset-x | offset-y | color */ box-shadow: 60px -16px teal; /* offset-x | offset-y | blur-radius ...
- [Security] Web Security Essentials
In this course, we'll learn how to exploit and then mitigate several common Web Security Vulnerabili ...
- this 深度面试题3
window.val = 1; var obj = { val: 2, dbl: function () { this.val *= 2; val *= 2; console.log(val); co ...