File Management.ppt_第1页
File Management.ppt_第2页
File Management.ppt_第3页
File Management.ppt_第4页
File Management.ppt_第5页
免费预览已结束,剩余39页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、File Management,Lecture 3,What is a file?,File is term applied to anything held on secondary storage Includes programs (source and executable) text files such as word documents, spreadsheet files, database files etc.,File naming,MS DOS format is generally up to eight character name followed by a dot

2、 and then a three character extension. Example Letter1.doc , hello.exe , stock.dat Linux/Unix file naming is more flexible can have something like myfile.example.doc normally .bin files are equivelent to exe files in windows.,Objectives of O.S.,Hide complexity of how files are saved from user Proble

3、ms with physical addressing, perform error checking, i/o tasks to storage. Develop file management strategies Explore files and folders Create, name, copy, move, and delete folders Name, copy, move, and delete files Work with compressed files,Organizing Files and Folders,A file, or document, is a co

4、llection of data that has a name and is stored in a computer You organize files by storing them in folders Disks contain folders that hold documents, or files Floppy disks Zip disks Compact Discs (CDs) Hard Disks Removable disks are inserted into a drive,Organizing Files and Folders,Understanding th

5、e Need for Organizing Files and Folders,Windows organizes the folders and files in a hierarchy, or file system Windows stores folders and important files that it needs when you turn on the computer in the root directory Folders stored within other folders are called subfolders,Understanding the Need

6、 for Organizing Files and Folders,Directories,A directory is a logical grouping of files All modern operating systems have a directory structure Why security and housekeeping on system Example on Linux system only root user will have access to sbin directory.,Linux/Unix file structure,File Managemen

7、t System,Provides a logical view for the user and hides the physical implementation Where a file is located and how it is stored on disk is role of OS Manages directory structures and space allocation for each I/O device Permits manipulation of data within a file Requests data transfers from I/O dev

8、ice drivers File security and protection of file integrity,File Management and I/O Functions,Separation between the two allows I/O devices can change while keeping the file system the same Redirecting of data is simple,File Manager Request Handling,File Storage,Over time file sizes change this can b

9、e a problem for OS. As files reduce get deleted, compressed etc spaces develop on disk fragmentation. OS provides fixed size blocks for storing data, called cluster. Problem is clusters are often not sequential.,File Access Methods,Sequential Access File is read in sequence from beginning to end Maj

10、ority of all files Program source and binary files Random Access Assumes file is made up of fixed length logical records Hashing is a common method used to calculate the location of an internal logical record Indexed Access Additional means for accessing and viewing records in a file Key indexes,Phy

11、sical File Storage,Contiguous Non-contiguous Linked Indexed Examples DOS/Windows FAT UNIX i-nodes Windows NTFS Free space management,Contiguous Storage Allocation,Assign blocks (all in a row) to hold the file Access is simple for both sequential and random methods Disadvantages Space must be large e

12、nough Have to take into account file growth May need to be moved if it outgrows its space Fragmentation of disk Allocation strategies to minimize fragmentation First-fit, best-fit Eventually disk becomes fragmented,Contiguous Storage Allocation,Linked Allocation,Non-contiguous Each block contains a

13、link to the next physical block Variant links in both directions Advantages no fragmentation Adding to a file is easy Disadvantages Not usable for random access Additional disk head searching Overhead in storing the pointers Recovery of a defective block is difficult,Linked Allocation,MS-DOS FAT,Fil

14、e Allocation Table (FAT) Table contains the first block of each file on the disk or disk partition Successive blocks contain a link to the next block Requires a tremendous amount of space File integrity can be easily compromised,MS-DOS FAT,Linked Allocation and File Allocation Table,Indexed Allocati

15、on,Index blocks for indexed allocation of linked files shown in MS-DOS FAT example,Indexed Allocation,Non-contiguous All link pointers are stored together in a single block called the index block One index block per file Advantages No fragmentation Can be used for random access Disadvantage Slower d

16、ue to additional access of the index block Additional disk head searching Recovery of a defective block is difficult,Unix i-nodes,Indexed file allocation Index block contains File attributes 10 direct blocks 1 single indirect 1 double indirect 1 triple indirect Advantages Fast for small blocks Can a

17、ccommodate very large files 100s of gigabytes,Unix i-nodes,Windows 2000 - NTFS,Dynamically sized volumes Volumes may be a fraction of a disk or span many disks Master File Table (MFT) of 1kb records 1st 16 records are attributes of the MFT ie system files used to manage the volume Each file has an M

18、FT entry,NTFS Volume Layout,Other Secondary Storage Allocation,Tape Allocation Not practical to reallocate space in the middle of the tape Files that grow must be re-written Files are stored contiguously whenever possible CD-ROM and DVD-ROM Allocation Block system described in Chapter 10 Eight level

19、s of subdirectories Directory format similar to MS-DOS although extensions permit longer filenames and deeper subdirectory levels Files can be stored non-contiguously,Directory Structure,Provides a means of organization so that files can be located easily and efficiently Hide the physical devices fr

20、om the logical view of the files Partitions Independent subsections of a device Volume Directory structure for a particular partition Needs to be mounted to be incorporated into the overall file system structure Contain file attributes,Tree-Structure Directory,Hierarchical with a top-level root dire

21、ctory from which all other directories stem All directories and files have names Separator Used to indicate subdirectories and files located in a directory / UNIX DOS, Windows Pathname Absolute full pathname starting from the root directory Relative pathname is created starting from the current dire

22、ctory Search Paths Directory locations that the operating system uses to locate files,Tree-Structure Directory,Linux/Unix Tree Structure,RAID,Redundant Array of Independent Disks Redundant Array of Inexpensive Disks 6 levels in common use Not a hierarchy Set of physical disks viewed as single logica

23、l drive by O/S Data distributed across physical drives Can use redundant capacity to store parity information,RAID 0,No redundancy Data striped across all disks Round Robin striping Increase speed Multiple data requests probably not on same disk Disks seek in parallel A set of data is likely to be s

24、triped across multiple disks,RAID 1,Mirrored Disks Data is striped across disks 2 copies of each stripe on separate disks Read from either Write to both Recovery is simple Swap faulty disk & re-mirror No down time Expensive,RAID 2,Disks are synchronized Very small stripes Often single byte/word Error correction calculated across corresponding bits on disks Multiple parity disks store Hamming code error correction in corresponding positions Lots of redundancy Expensive Not used,RAID 3,Similar t

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论