besides file name wh开发者_JAVA技巧at meta data do a plain text file contain ?
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.
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.
On Linux (not in the file content, but in the filesystem):
- 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.
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.
Filename, size etc is file system metadata.
A plain text file with content "a b c" could have encoding as metadata
精彩评论