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|&|>>|<<的更多相关文章

  1. C#读写文件的方法汇总_C#教程_脚本之家

    C#读写文件的方法汇总_C#教程_脚本之家 http://www.jb51.net/article/34936.htm

  2. 你绝对想不到R文件找不到(cannot resolve symbol R)的原因

    你绝对想不到R文件找不到(cannot resolve symbol R)的原因 最近在项目开发中 Android Studio 的 R 文件突然找不到了.IDE 中出现了以下提示 cannot re ...

  3. python IOError: invalid mode ('r') or filename

    我想要用pandas.read_table()将数据表中的数据读到一个pandas DataFrame对象中: import pandas as pd unames = ['user_id', 'ge ...

  4. Python报错IOError: [Errno 22] invalid mode ('r') or filename

    IOError: [Errno 22] invalid mode ('r') or filename: 这种错误的出现是在使用built-in函数file()或者open()的时候. 或者是因为文件的 ...

  5. Android开发_*.R文件无法自动生成

    问题描述:             今天是我决定专注Android开发的第一天,我在网上下载了一个数独游戏的源码,准备开始着手学习.在导入之后出现Java文件中import *.R文件报错,在gen目 ...

  6. c语言_文件操作_FILE结构体解释_涉及对操作系统文件FCB操作的解释_

    1. 文件和流的关系 C将每个文件简单地作为顺序字节流(如下图).每个文件用文件结束符结束,或者在特定字节数的地方结束,这个特定的字节数可以存储在系统维护的管理数据结构中.当打开文件时,就建立了和文件 ...

  7. Python文件读写之r+/w+/a+

    读模式 r 打开不存在的文件会报错.不能写:如不指定模式则默认是r 写模式 w 打开不存在的文件会,会新建一个文件:打开存在的文件会先清空后覆盖原有文件:不能读 追加模式 a 打开不存在的文件会,会新 ...

  8. 第3章 文件I/O(8)_贯穿案例:构建标准IO函数库

    9. 贯穿案例:构建标准IO函数库 //mstdio.h #ifndef __MSTDIO_H__ #define __MSTDIO_H__ #include <unistd.h> #de ...

  9. python文件操作各种模式和常用方法总结r r+ rb r+b

    1.读,r r+ rb r+b read() 全部读取 read(n) 读取一部分 r模式下:n 个字符. rb模式下:n个 字节. readline() 按行读取. readlines() 返回个列 ...

随机推荐

  1. JAVA函数库

    1. 文件相关 1.1 判断目录是否存在 public static boolean dictionaryExist(String path) { File file = new File(path) ...

  2. ping内网服务器 新

    #!/bin/bash ip="192.168.1."lastip=(200201202210211212220221222) #ip列表 可以继续添加 ps () { ping ...

  3. Mysql数据库忘记密码找回方法

    Mysql数据库忘记密码找回 a 停止mysql服务 /etc/init.d/mysql stop b 使用--skip-grant-tables启动mysql,忽略授权登录验证 mysqld_saf ...

  4. springMVC源码阅读-通过画图理解一个请求生命周期(十二)

  5. 批量导入数据表(oracle)

    批量导入数据表(oracle) 1.登陆plsql 2.找到菜单栏 工具>>导入数据>>新增图标(会提示选择*.csv文件) 选择如上图所示 3.选择数据并导入 4.下图为执行 ...

  6. 使用Matplotlib

    1.Matplotlib是python的一个绘图库. 2.from matplotlib import pyplot as plt

  7. Dijkstra与Floyd算法

    1. Dijkstra算法 1.1 定义概览 Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径.主要特点是以起始点为中心向外层层扩展,直到扩展到终点 ...

  8. 在CentOS/RHEL 7下修改网卡名为 eth0 形式

    为了统一企业中的多版本系统共存的环境,这里将网卡名称设置为 eth* 的形式,不使用CentOS/RHEL 7默认的特殊网卡命名规则.所以需要在安装初始的时候,需要增加内核参数. 在启动界面,按 TA ...

  9. java基础-泛型的优点

    1.性能 对值类型使用非泛型集合类,在把值类型转换为引用类型,和把引用类型转换为值类型时,需要进行装箱和拆箱操作.装箱和拆箱的操作很容易实现,但是性能损失较大.假如使用泛型,就可以避免装箱和拆箱操作. ...

  10. RAC,ReactiveSwift

    1.创建信号 // 1.通过信号发生器创建(冷信号) let producer = SignalProducer<String, NoError>.init { (observer, _) ...