1 / 12

The Fun That Is File Structures

The Fun That Is File Structures. Pages 256-261 By: Christine Zeitschel. 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.

grace-wong
Télécharger la présentation

The Fun That Is File Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 • If trans key is less than master file key, add them • If equal either change the master file with a revision (R) or delete (D) • 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. KEY 3542 3543 3544 3545 3546 ADDRESS James Dean Marilyn Monroe John Kennedy Bob Dole Robert Kennedy Index File

  12. 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. Hashed Files

More Related