Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Fun That Is File Structures Pages 256-261 By: Christine Zeitschel.

Similar presentations


Presentation on theme: "The Fun That Is File Structures Pages 256-261 By: Christine Zeitschel."— Presentation transcript:

1 The Fun That Is File Structures Pages 256-261 By: Christine Zeitschel

2 File Structure Basics: A file is a collection of related information into a unit whose primary purpose is to store data. Files are stored in auxiliary or secondary storage devices. Files store data in a more permanent form than primary memory.

3 FILES- Secondary storage devices Two most common forms- disk & tape These files can be both read and written Therefore- A file is a group of data with records of more than one field.

4 Access Methods Determine how records are retrieved, in an order or randomly. Use a sequential file to obtain data one record after another Use random access to pick one specific file. Two types include: indexed & hashed files

5 Sequential Files A file which records can only be selected one after another, in other words it’s like reading every page of a book to find one quote, but instead that quote is record for a computer.

6 More sequential files The only thing known by the operating system for sequential files is that records come one after another and that the end-of file (EOF) is the end marker for records.

7 Processing Sequential Files Sequential access is more effective when a person needs to retrieve each record like a paycheck at the end of the month for printing. This method would not work as well for a school trying to find one persons record and going through everyone’s record to get to yours. Updating becomes difficult as each file must be checked in order for updates.

8 Four Types of Files for Updating New Master file- has most current data Old Master file- permanent file which needs updating Transaction file- has changes which are needed to be made to the master file, where you can add, delete or change transactions— a key is need like an individual ID for a field to process transactions Error Report file- contains a list of all errors during update process

9 A Deeper Look at Keys- all files must have the same keys 1)If trans key is less than master file key, add them 2)If equal either change the master file with a revision (R) or delete (D) 3)If trans key is greater put old master file key as new master file key, or add (A) new code

10 Indexed Files A file made up of a data file, with only 2 fields- the key and the address Index files act just as an index would for a history book, they allow you to do a search for a subject like WWI, but instead using binary and then they take you to that file.

11 Index File KEY 3542 3543 3544 3545 3546 ADDRESS James Dean Marilyn Monroe John Kennedy Bob Dole Robert Kennedy

12 Hashed Files Uses a function to map files The user provides a key the function maps the key to the address and then to the operating system to be retrieved KEY-  Address = Hash Function (Key)  Address The work of an index is eliminated by the use of a function to do the work.


Download ppt "The Fun That Is File Structures Pages 256-261 By: Christine Zeitschel."

Similar presentations


Ads by Google