Vous êtes sur la page 1sur 15

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
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
Objectives for a
File 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
Objectives for a
File 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

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 users
files in a form appropriate to the problem
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 users files in case of damage

Each user should be able to access the users files
by using symbolic names
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.
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.
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.
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.
Direct File Organization


Employee
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
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.
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
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

Vous aimerez peut-être aussi