文件的 "internal table" 是什么?

What is "internal table" for a file?

来自 Tanenbaum 关于文件操作的现代操作系统:

  1. Open. Before using a file, a process must open it. The purpose of the open call is to allow the system to fetch the attributes and list of disk addresses into main memory for rapid access on later calls.
  2. Close. When all the accesses are finished, the attributes and disk addresses are no longer needed, so the file should be closed to free up internal table space.

什么是"internal table"?

在阅读书中的引用之前,我没有找到 "internal table" 的定义。它也有其他名称吗?

是不是在主存里,专门为一个文件创建的?

谢谢。

对于每个打开的文件,操作系统都会维护一个服务结构,用于跟踪该文件、文件位置、打开模式等。关闭文件后,该结构将不再需要并被丢弃。这就是该措辞所指的 - 在某些操作系统上,将使用称为 internal table space 的东西来完成,但这是一个实现细节。

Here's 对相关问题的一个很好的回答。

通常,支持多级数据结构来访问一个文件。在 unix 中,通常有两个级别:操作系统和库。在 VMS 中,分为三个级别。系统服务、RMS 和库。

在系统级别,文件成为逻辑设备。 (Unix,不寻常地,在这个级别跟踪读取位置)。

在某些系统(IBM、VMS)中可以找到记录级别的访问权限。这用于文件系统支持多个文件结构(例如,流、固定、变量、索引)的地方。 Unix 只做流。它也可以处理缓冲。

库访问提供特定于语言的功能。 C-RTL 函数 fopen() returns 您通常访问的 FILE* 结构。 open() 函数是 Unix 系统级函数(在某些系统上作为库函数实现)。

每一层都会创建需要释放的额外数据结构。