有关文件的快速问题. [英] Quick questions regarding files.

查看:96
本文介绍了有关文件的快速问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我有一个关于文件属性的快速问题.我只是在谈论诸如只读等一般文件属性.更重要的是,这些属性是否存储在文件本身中?如果是,它们存储的格式是什么?就个人而言,我认为它们以某种方式映射到了操作系统本身而不是文件中,但是我只是想确定一下.

我还有另一个问题,一般的二进制/文本文件的终止顺序或字符是什么?用Layman的说法,什么标志着文件的结尾?谢谢您的帮助.问候.

二进制文件,是指存储唯一数据结构的文件.

Hello, I have a quick question concerning file attributes. I am only talking about general file attributes such as read only, etc. More to the point, are these attributes stored within the file itself, and if so, what is the format that they are stored in? Personally, I''m thinking that they are somehow mapped within the operating system itself as opposed to the file, but I just want to be sure.

I also have another question, what is the termination sequence or character for a general binary/text file? In Layman''s terms, what marks the end of a file? Thanks for the help. Regards.

By binary file, I mean a file that stores unique data structures.

推荐答案

只读属性和类似属性是文件.它们由操作系统存储,无法在文件数据中找到.

文本文件通常实际上没有在数据中存储文件字符(或序列)的结尾.您可以通过读取的字节数知道文件的末尾.可以使用文件ASCII字符的结尾,但是通常不应将其视为文件的结尾.一些库还会返回一个特殊的常数(EOF),该常数指示文件的结尾.

另外,不存在具有特定解释​​(例如文件结尾)的通用二进制文件.所有文件都是二进制文件,包括文本文件.
The read-only attribute and similar attributes are part of the meta-data for the file. They are stored by the operating system and cannot be found in the file data.

Text files don''t typically actually have an end of file character (or sequence) stored in the data. You know where the end of the file is by the number of bytes read. There is an end of file ASCII character that can be used, but typically should not be treated as the end of the file. Some libraries will also return a special constant (EOF) that indicates the end of a file.

Also, there is no such thing as a general binary file that has a specific interpretation (such as an end of file character). All files are binary files, including text files.


这篇关于有关文件的快速问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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