File Handling

INTRODUCTION: A file is external collection of related data treated as a unit. The primary purpose of a files is to keep a record of our data. Since the contents of Primary memory are lost when the computer is shut doe, we need files to store our date in a more permanent form. Additionally, the collection of data is often too large to reside entirely in main memory at one time. There we must have the ability to read and write portions of the data while the rest remain in the file.

FILE ORGANIZATION; Files are stored in auxiliary or secondary storage devices. The tow most common forms of secondary storage are disk and tape. Files in secondary storage can be both read and write. IN other words, there are several ways to organize the of file organization i.e. Sequential and Random Access files. both methods of organization have their specific advantages and disadvantages.

SEQUENTIAL FILE ORGANIZATION:  The records written in this file organization are stored one after another in a particular sequence. The first record written in the file becomes the first record and the last record is always inserted at the end. If we want to access a record then we have to proceed all the record in the file and thus the retrieval of desired record is extremely slow. Records in this type of organization cannot be retrieved directly. This type of organization is suitable for go to next record processing in which we start from the beginning and move on e record forward at a time.

RANDOM ACCESS/ HASHED FILE ORGANIZATION: Contrary to previous organization data can be stored and accessed randomly in this type of file organization. Records can be accessed directly without accessing all he records. Random access files are designed to reduce the delay in finding a record. IN this type of organization each record is assigned with a number starting retrieved by its number rather than by performing a linear search of the records.


More by this Author


Comments

No comments yet.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working