美文网首页
第五章 文件管理

第五章 文件管理

作者: 喜忧参半 | 来源:发表于2021-08-29 21:00 被阅读0次

    OS的四大子系统

    Process Memory I/O Devices File
    Hardware Hardware Hardware Software

    逻辑组织

    • 文件管理
    • 系统文件的逻辑组织
    • 文件目录
    • 文件共享
    • 文件存储空间的管理

    文件管理(File Management)

    • File management system is consideredpart of the operating system.文件管理系统被认为是操作系统的一部分。
    • Input to applications is by means of a file.应用程序的输入是通过文件进行的。
    • Output is saved in a file for long-termstorage. 输出保存在文件中以便长期存储。

    Objectives for a File Management System

    • Meet the data management needs and
      requirements of the user.
      (符合系统管理数据的需要及用户的需求)
    • Guarantee that the data in the file are valid.
      (确保文件中的数据有效)
    • Optimize performance.
      (保证系统性能及用户对响应时间的要求)
    • Provide I/O support for a variety of storagedevice types.
      (为各种存储设备类型提供I/O支持)
    • Minimize or eliminate the potential forlost or destroyed data.
      (减少或避免数据丢失及损坏)
    • Provide a standardized set of L/Ointerface routines.
      (提供标准的IO接口)
    • Provide I/O support for multiple users.
      (支持多用户环境下多个用户的IO操作)

    File Management Functions

    • Identify and locate a selected file.
      标识并找到选定的文件。
    • Use a directory to describe the location ofall files plus their attributes.
      使用目录来描述所有文件的位置以及它们的属性。
    • On a shared system describe user accesscontrol.
      在共享系统上描述用户访问控制。
    • Blocking for access to files.
      阻止对文件的访问。
      -Allocate files to free blocks.
      将文件分配给空闲块。
    • Manage free storage for available blocks.
      -管理可用区块的空闲空间。

    Device Drivers

    • Lowest level.
      最低级别。
    • Communicates directly with peripheraldevices.
      直接与外围设备通信。
    • Responsible for starting I/O operationson a device.
      负责启动I/O操作设备。
    • Processes the completion of an I/orequest.
      处理I/O请求的完成。

    Basic File System

    • Physical I/O.
      物理I/O
    • Deals with exchanging blocks of data.
      处理数据块的交换。
    • Concerned with the placement of blocks.
      与块的放置有关
    • Concerned with buffering blocks in main memory.
      与内存中的缓冲块有关。

    Basic I/O Supervisor

    • Responsible for file I/O initiation andtermination.
    • Control structures are maintained.
    • Concerned with scheduling access tooptimize performance.
    • I/O buffers are assigned and secondarymemory is allocated.

    Logical I/O

    • Enables users and applications to access records.
      允许用户和应用程序访问记录。

    • Provides general-purpose record I/ocapability.
      提供通用记录I/ocapability。

    • Maintains basic data about file.
      维护有关文件的基本数据。

    Access Method

    • Reflect different file structures.
    • Different ways to store and process data.
      如Pile、顺序访问、索引顺序访问、索引访问、Hash访问法等访问方法

    File Organization

    • File organization refers to the logicalstructuring of the records as determinedby the way in which they are accessed.
      文件组织是指由访问方式决定的记录的逻辑结构。
    • The physical organization of the file onsecondary storage depends on theblocking strategy and the file allocationstrategy.
      存储上文件的物理组织取决于阻塞策略和文件分配策略。

    Criteria for File Organization

    • Rapid access
      Needled when accessing a single record.
      Not needed for batch mode.
    • Ease of update
      File on CD-ROM will not be updated, so thisis not a concern.
    • Economy of storage
      Should be minimum redundancy in the data.- Redundancy can be used to speed accesssuch as an index.
      -Simple maintenance·
    • Reliability

    File Organization

    • Pile file(堆文件)
    • Sequential file(顺序文件)
    • Indexed sequential file(索引顺序文件)
    • Indexed file(索引文件)
    • Direct, or Hashed file(直接或hash文件)
    堆文件(pile)
    • Data are collected in the order theyarrive.
      数据是按到达的顺序收集的。
    • Purpose is to accumulate a mass of data and save it.
      目的是积累大量数据并保存它。
    • Records may have different fields.
      记录可能有不同的字段。
    • No structure.
      无结构文件。
    顺序文件(Sequential File)
    • Fixed format used for records.
      用于记录的固定格式。
    • Records are the same length.
      记录的长度相同。
    • All fields the same (order and length).
      所有字段都相同(顺序和长度)。
    • Field names and lengths are attributes ofthe file.
      字段名和长度是文件的属性。
      One field is the key filed
      -Uniquely identifies the record.
      -Records are stored in key sequence.
    • The only one that is easily stored on tapes as wellas disk .
      唯一 一种可以同时存储在磁带和磁盘上的。
    • Typically used in batch applications and theapplications processing of all records.
      通常用于批处理应用程序和处理所有记录的应用程序。
    • For querying and/or updating an individlual record,it provides poor performance.
      对于查询和/或更新单个记录,它的性能较差。
    • New records are placed in a log file or transactionfile.
      新记录放置在日志文件或transactionfile中。
    • Batch update is performed to merge the log filewith the master file.
      执行批更新以将日志文件与主文件合并。

    相关文章

      网友评论

          本文标题:第五章 文件管理

          本文链接:https://www.haomeiwen.com/subject/etugiltx.html