文件和随机访问文件有什么区别?
文件和随机访问文件有什么区别?
what is the difference between file and random access file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
文件和随机访问文件有什么区别?
what is the difference between file and random access file?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
随机访问文件是一种文件,您可以“跳转”到其中的任何位置,而无需按顺序读取直到您感兴趣的位置。
例如,假设您有一个 1MB 文件,并且您对之后开始的 5 个字节感兴趣100k 数据。 随机访问文件将允许您在一次操作中“跳转”到第 100k 个位置。 非随机访问文件将要求您首先读取 100k 字节,然后才读取您感兴趣的数据。
希望有所帮助。
澄清:此描述与语言无关,并且与任何特定语言/框架中的任何特定文件包装器无关。
A random access file is a file where you can "jump" to anywhere within it without having to read sequentially until the position you are interested in.
For example, say you have a 1MB file, and you are interested in 5 bytes that start after 100k of data. A random access file will allow you to "jump" to the 100k-th position in one operation. A non-random access file will require you to read 100k bytes first, and only then read the data you're interested in.
Hope that helps.
Clarification: this description is language-agnostic and does not relate to any specific file wrapper in any specific language/framework.
这几天几乎什么都没有。 曾经有一段时间,在某些操作系统中存在不同类型的文件 - 其中一些可以随机访问(在文件中的任何点),而另一些则只能按顺序访问。 当您使用顺序介质(例如磁带)时,这更有意义。 如今任何有价值的文件系统都只支持随机访问。
Almost nothing these days. There used to be a time in certain operating systems where there were different types of files - some of which could be accessed randomly (at any point in the file) and others which could only be accessed sequentially. This made more sense when you were using a sequential medium such as tape. Any file system worth its salt these days only supports random access.