什么是“常规文件"?在Java中? [英] What is a "regular file" in Java?

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

问题描述

BasicFileAttributes 类,用于检查文件系统中文件的属性,具有方法

The class BasicFileAttributes, for examining the properties of a file in the file system, has the method isRegularFile(). Unfortunately, the Javadoc description is rather lacking:

告诉文件是否为具有不透明内容的常规文件.

Tells whether the file is a regular file with opaque content.

这是什么意思?具有不透明内容的常规文件到底是什么?从类中的其他方法可以看出,它不是目录或符号链接,因此我倾向于认为这是其他所有内容.但是,显然存在某种类型的不规则文件",因为存在一种称为

What does this mean? What exactly is a regular file with opaque content? I can tell from the other methods in the class that it's not a directory or symbolic link, so I'm inclined to think that it's everything else. However, there apparently is some type of "irregular file" because a method exists called isOther(), which returns true if it's not a directory, symbolic link, or "regular file".

那么Java中的常规文件到底是什么?

So what exactly is an regular file in Java?

推荐答案

例如在UNIX中,常规文件是某种形式的特殊文件.特殊文件包括符号链接和目录.常规文件是永久存储在文件系统中的字节序列.

For example in UNIX, a regular file is one that is not special in some way. Special files include symbolic links and directories. A regular file is a sequence of bytes stored permanently in a file system.

阅读此答案@ UNIX& Linux stackexchange:什么是常规文件?

Read this answer @ UNIX & Linux stackexchange: What is a regular file?

我认为rm -i是别名,可能是rm -i. 常规"部分不 尤其是什么意思,仅表示不是管道, 设备,套接字或其他任何特殊"功能.

I figure rm -i is an alias, possibly rm -i. The "regular" part doesn't mean anything in particular, it only means that it's not a pipe, device, socket or anything other "special".

表示文件不是符号链接,管道,rand,null,cpu等. 也许您已经听说过Linux哲学,但一切都是文本.这 从字面上看并不正确,但它暗示了主导的运营环境 可以将字符串处理工具应用于文件系统元素的位置 直接地.在这种情况下,这意味着以更实际的方式.到 单独查看检测步骤,尝试使用命令文件,如文件中所示 /etc/passwd或文件/dev/null.

it means the file is not a symlink, pipe, rand, null, cpu, etc. Perhaps you have heard the linux philosophy everything is a text. This isn't literally true, but it suggests a dominant operational context where string processing tools can be applied to filesystem elements directly. In this case, it means that in a more literal fashion. To see the detection step in isolation, try the command file, as in file /etc/passwd or file /dev/null.

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

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