Module11:File- System Interface(文件系统接口) File Concept(文件概念) Access Methods(存取方法) Directory Structure(目录结构) Protection(保护) File-System Structure(文件系统结构) Allocation Methods(分配方法) Free-Space Management(自由空间管理) Directory Implementation(目录实现) Efficiency and Performance(效率和性能) Recovery 恢复) Applied Operating System Concepts 1 Silberschatz, Galvin, and Gagne @1999
11.1 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts Module 11: File-System Interface(文件系统接口) • File Concept(文件概念) • Access Methods(存取方法) • Directory Structure (目录结构) • Protection(保护) • File-System Structure (文件系统结构) • Allocation Methods(分配方法) • Free-Space Management (自由空间管理) • Directory Implementation(目录实现) • Efficiency and Performance(效率和性能) • Recovery(恢复)
File Concept(文件概念) ° Contiguous logical address space(相邻的逻辑地址空间) ° Types:(类型) Data(数据) Numeric(数字) Character(字符) Binary(二进制) Program(程序) Applied Operating System Concepts 112 Silberschatz, Galvin, and Gagne @1999
11.2 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts File Concept(文件概念) • Contiguous logical address space(相邻的逻辑地址空间) • Types: (类型) – Data(数据) Numeric(数字) Character(字符) Binary(二进制) – Program(程序)
File structure(文件结构) None- sequence of words, bytes(顺序的字和字节) Simple record structure(简单的记录结构) Lines(线性) Fixed length(固定长度) Variab|e| ength(可变长度) ° Complex Structures(复杂结构) Formatted document(规格化的文档) Relocatable load file(可重定位文件) Can simulate last two with first method by inserting appropriate control characters (可以用第一个方法通过增加适当的控制字符来模拟后两种方法 Who decides(需要决定) Operating system(操作系统) program(程序) Applied Operating System Concepts 11.3 Silberschatz, Galvin, and Gagne @1999
11.3 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts File Structure(文件结构) • None - sequence of words, bytes(顺序的字和字节) • Simple record structure(简单的记录结构) – Lines (线性) – Fixed length(固定长度) – Variable length(可变长度) • Complex Structures(复杂结构) – Formatted document(规格化的文档) – Relocatable load file(可重定位文件) • Can simulate last two with first method by inserting appropriate control characters. (可以用第一个方法通过增加适当的控制字符来模拟后两种方法 ) • Who decides(需要决定) – Operating system(操作系统) – Program(程序)
Fille attributes(文件属性) Name -only information kept in human-readable form. (文件名:唯一的以人们可以理解的方式保存的信息) Type- needed for systems that support different types (类型:需要可以支持多种类型的系统 Location- pointer to file location on device (位置:指向文件在设备上的存储位置的指针 size- current file size.(大小:当前文件的大小) Protection-controls who can do reading, writing, executing (保护:控制对文件的读取,改写和执行的权限) esmn时间,日期和用户身份:保护和安 全需要的数据) Information about files are kept in the directory structure, which is maintained on the disk.(文件的信息保存在磁盘上的目录结构中) Applied Operating System Concepts 11.4 Silberschatz, Galvin, and Gagne @1999
11.4 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts File Attributes(文件属性) • Name – only information kept in human-readable form. (文件名:唯一的以人们可以理解的方式保存的信息) • Type – needed for systems that support different types. (类型:需要可以支持多种类型的系统) • Location – pointer to file location on device. (位置:指向文件在设备上的存储位置的指针) • Size – current file size. (大小:当前文件的大小) • Protection – controls who can do reading, writing, executing. (保护:控制对文件的读取,改写和执行的权限) • Time, date, and user identification – data for protection, security, and usage monitoring.(时间,日期和用户身份:保护和安 全需要的数据) • Information about files are kept in the directory structure, which is maintained on the disk.(文件的信息保存在磁盘上的目录结构中)
File operations(文件操作) Create(创建) Write(改写) Read(读取) ° reposition within file- file seek(重定位文件,文件搜索) Delete(删除) ° Truncate(截去) open (Fi-search the directory structure on disk for entry Fis and move the content of entry to memory. (打开(Fi):在磁盘上的目录结构中搜寻F的表项,然后把表项 的内容移动到内存中) close(Fi-move the content of entry F; in memory to directory structure on disk. (关闭(Fi):把F在内存中的表项内容移动到磁盘中) Applied Operating System Concepts 1.5 Silberschatz, Galvin, and Gagne @1999
11.5 Silberschatz, Galvin, and Gagne ©1999 Applied Operating System Concepts File Operations(文件操作) • Create(创建) • Write(改写) • Read(读取) • reposition within file – file seek(重定位文件,文件搜索) • Delete(删除) • Truncate(截去) • open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory. (打开(Fi):在磁盘上的目录结构中搜寻Fi的表项,然后把表项 的内容移动到内存中) • close (Fi) – move the content of entry Fi in memory to directory structure on disk. (关闭(Fi):把Fi在内存中的表项内容移动到磁盘中)