organization of files in computer

15
Organization of Files in Computer

Upload: ankita-rai

Post on 23-Oct-2016

6 views

Category:

Documents


2 download

DESCRIPTION

its very useful...

TRANSCRIPT

Page 1: Organization of Files in Computer

Organization of Files in Computer

Page 2: Organization of Files in Computer

File Management

• File management system is considered part of the operating system

• Input to applications is by means of a file

• Output is saved in a file for long-term storage

Page 3: Organization of Files in Computer

File Management System

• The way a user of application may access files

• Programmer does not need to develop file management software

• File processing refers to an environment in which data are physically organised into files

Page 4: Organization of Files in Computer

Objectives for aFile Management System

• Meet the data management needs and requirements of the user

• Guarantee that the data in the file are valid

• Optimize performance

• Provide I/O support for a variety of storage device types

Page 5: Organization of Files in Computer

Objectives for aFile Management System

• Minimize or eliminate the potential for lost or destroyed data

• Provide a standardized set of I/O interface routines

• Provide I/O support for multiple users

Page 6: Organization of Files in Computer

Minimal Set of Requirements

• Each user should be able to create, delete, read, and change files

• Each user may have controlled access to other users’ files

• Each user may control what type of accesses are allowed to the users’ files

• Each user should be able to restructure the user’s files in a form appropriate to the problem

Page 7: Organization of Files in Computer

Minimal Set of Requirements

• Each user should be able to move data between files

• Each user should be able to back up and recover the user’s files in case of damage

• Each user should be able to access the user’s files by using symbolic names

Page 8: Organization of Files in Computer

Raw data is organized into the following forms : Character - letter, digit, or special character

like $, ? Field - a set of related characters, e.g. street

address Record - a collection of related fields, e.g.

personal particular File - a collection of related records, e.g. all

member records of a health club. Database - a collection of interrelated files

stored together with minimum redundancy.

Page 9: Organization of Files in Computer

File Organization

Three major methods of storing files of data in secondary storage : Sequential file

records are organized in a particular order. Direct file

records are not organized in any special order.

Indexed file records are organized sequentially but

indexes are built into the file to allow a record to be accessed either sequentially or directly.

Page 10: Organization of Files in Computer

Sequential File Organization

Records are in order according to a key field (a unique identifier).

All the preceeding records must be read before reaching a particular record.

Tape storage is limited to sequential file organization.

Page 11: Organization of Files in Computer

Direct File Organization Allow the computer to go directly to the desired record by

using a record key.

Disk device is called a direct-access storage device.

Has the ability to access any given record instantly.

A predictable system for placing a record at a disk access and for retrieving the record at a subsequent time is to choose a certain formula to apply to the record key, thereby deriving a number to use as the disk address.

Hashing (or randomizing) - a process of applying a mathematical operation to a key to yield a no. that represents the address.

Page 12: Organization of Files in Computer

Direct File OrganizationEmployee No. Key

Record address on file

Address Key

442 0 0 442 661 11 1 137 7 2 114 10 3 809 618 7 8 4 265 5 50 5 265 809 3 Prime no. 13 661 Key 6

65 7 137 11 Remainder 8 618 9 10 114 11 661 12

Disk Fig. 1 An example of direct access

Page 13: Organization of Files in Computer

Indexed File Organization Represent a compromise between the sequential and direct

methods.

Records are stored in sequential order, but the file also contains an index.

The index contains entries consisting of the key to each record and the corresponding disk address.

The index is like a directory, with the keys to all records listed in order.

Direct access is accomplished by locating the record key in the index.

Sequential access is also accomplished by accessing the first record and proceeding through the rest.

Page 14: Organization of Files in Computer

PC File Systems

DOS (MS-DOS, PC-DOS, etc) FAT (File Allocation Table) - a main logical

structure FAT12 - use by floppy disk FAT16 - use by hard disk up to 2 GB

Windows 95 FAT12, FAT16 VFAT - basically the same as FAT with several

enhancements, e.g. support of long file name Windows 95 OSR2

those supported by Windows 95 FAT32 - use by hard disk with capacity greater

than 2 GB

Page 15: Organization of Files in Computer

PC File Systems

Windows NT NTFS

Completely different from and incompatible with FAT.

A robust and full-featured system that includes full permissions control and attribute settings, etc.

FAT