5.Internal file structure How to locate an offset within a file? Logical file (record)(vary in length) -Physical block(fixed size) Solution:Packing-packing a number of logical records into physical blocks. Pack unpack:convert between logical records and physical blocks Internal fragmentation will occur Logical records Physical blocks 4口”4814在4色,主)QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. Internal file structure ▶ How to locate an offset within a file? ▶ Logical file (record) (vary in length) → Physical block (fixed size) ▶ Solution: Packing – packing a number of logical records into physical blocks. ▶ Pack & unpack: convert between logical records and physical blocks ▶ Internal fragmentation will occur Logical records Physical blocks
Outline Access Methods(访问方式) 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outline Access Methods (访问方式)
Access Methods(访问方式) Files store information.When it is used,this information must be accessed and read into computer memory On a logical perspective of users,access a file of records 1.Sequential Access(顺序访问方式) 2.Direct Access(直接访问方式) 3.Indexed Access(索引访问方式) 4口”484在4色,主月QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Access Methods (访问方式) ▶ Files store information. When it is used, this information must be accessed and read into computer memory ▶ On a logical perspective of users, access a file of records 1. Sequential Access (顺序访问方式) 2. Direct Access (直接访问方式) 3. Indexed Access (索引访问方式)
1.Sequential Access(l顺序访问方式) Sequential Access(顺序访问方式):the simplest access method. Information in the file is processed in order,one record after the other. This is a most common access mode. For example:editors,compilers A tape model of file File operations the effect on file pointer read/write next reset rewind/forward n current position beginning end rewinc- ead or write→ 4口”4614在4,主9QC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. Sequential Access (顺序访问方式) ▶ Sequential Access (顺序访问方式): the simplest access method. Information in the file is processed in order, one record after the other. ▶ This is a most common access mode. For example: editors, compilers ▶ A tape model of file ▶ File operations & the effect on file pointer ▶ read/write next ▶ reset ▶ rewind/forward n beginning current position end rewind read or write