什么是Unix上的常规文件 [英] what is a regular file on unix

查看:122
本文介绍了什么是Unix上的常规文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到 test 的手册页c $ c>



其中提到了以下内容。

  -e路径名
如果路径名解析为存在的文件,则为真。如果路径名无法解析,则为False。
-f路径名
如果路径名解析为存在的文件并且是常规文件,则为真。如果路径名无法解析,或者路径名解析为存在但不是常规文件的文件,则为False。

-f 标志表示
如果路径名解析为存在的文件并且是普通文件,则为真
任何人都可以告诉什么是常规文件,哪些不是常规文件。非常规文件是设备,管道,套接字...尝试 [-f / dev / tty0] 。符号链接也是非常规的,但是它们被 test -f 解决


I saw the man page of test.

where the below is mentioned.

-e  pathname
    True if pathname resolves to a file that exists. False if pathname cannot be resolved.
-f  pathname
    True if pathname resolves to a file that exists and is a regular file. False if pathname cannot be resolved, or if pathname resolves to a file that exists but is not a regular file.

the -f flag says True if pathname resolves to a file that exists and is a regular file Could anybody please tell what is a regular file and what is not a regular file.

解决方案

Non-regular files are devices, pipes, sockets... try [ -f /dev/tty0 ], for example. Symlinks are also non-regular, but they're resolved by test -f.

这篇关于什么是Unix上的常规文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆