Linux 文本文件的元数据

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4417452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 00:16:27  来源:igfitidea点击:

Meta data of text file

windowslinuxunixtextmetadata

提问by user537488

besides file name what meta data do a plain text file contain ?

除了文件名之外,纯文本文件还包含哪些元数据?

采纳答案by tvanfosson

I can think of lots of metadata that even a plain text file has -- creator, size, permissions, last accessed time, last modified time, etc. -- some of which probably depend on which OS you're talking about. I'd suggest looking at the directory operations and/or the file data structures in the system libraries on the particular OS for a more complete list for each particular OS.

我可以想到许多元数据,即使是纯文本文件也有——创建者、大小、权限、上次访问时间、上次修改时间等——其中一些可能取决于您正在谈论的操作系统。我建议查看特定操作系统上系统库中的目录操作和/或文件数据结构,以获得每个特定操作系统的更完整列表。

Depending on the usage of the file, it might contain some metadata -- for example, a script file might indicate the program used to run the script at the top -- but in general a plain text file doesn't contain metadata itself.

根据文件的用途,它可能包含一些元数据——例如,脚本文件可能会在顶部指明用于运行脚本的程序——但通常纯文本文件本身不包含元数据。

回答by Jonathan Wood

Depends what you mean by "meta data". The OS tracks filename, file size, create and modified dates, attributes, etc. for ALL files--not just text files.

取决于您所说的“元数据”是什么意思。操作系统跟踪所有文件的文件名、文件大小、创建和修改日期、属性等——不仅仅是文本文件。

But I'm not sure I even consider that meta data. To me I think of a plain text file as not containing any meta data at all.

但我不确定我是否考虑过元数据。对我来说,我认为纯文本文件根本不包含任何元数据。

回答by David

What file system? Strictly speaking, a "plain text file" doesn't contain any meta data, not even the name of the file. All of that is handled by the file system.

什么文件系统?严格来说,“纯文本文件”不包含任何元数据,甚至不包含文件名。所有这些都由文件系统处理。

回答by thejh

On Linux (not in the file content, but in the filesystem):

在 Linux 上(不在文件内容中,而是在文件系统中):

  • Permissions
  • Owner
  • Group
  • Size
  • References Count
  • Date of last change
  • Name
  • 权限
  • 所有者
  • 团体
  • 尺寸
  • 引用计数
  • 上次更改日期
  • 姓名

There are a few others (like a readonly flag), but you will usually not need them.

还有其他一些(例如只读标志),但您通常不需要它们。

回答by Random

Filename, size etc is file system metadata.

文件名、大小等是文件系统元数据。

A plain text file with content "a b c" could have encoding as metadata

内容为“ab c”的纯文本文件可以编码为元数据