Lecture3_FileOrganization
Lecture3_FileOrganization
Lecture 3
File System
Mohamed Mead
Introduction
A file is an organized collection of data.
Record
File
Database
field
A field is the basic element of data.
An individual field contains a single value, such as an
employee’s last name, a date, or the value of a
sensor reading.
It is characterized by its length and data type (e.g.,
ASCII string, decimal). Depending on the file
design, fields may be fixed length or variable
length.
record
A record is a collection of related fields that can be treated
as a unit by some application program.
For example, an employee record would contain such fields as
name, social security number, job classification, date of hire,
and so on.
Again, depending on design, records may be of fixed length or
variable length.
A record will be of variable length if some of its fields are of
variable length or if the number of fields may vary.
File
A file is a collection of similar records.
The file is treated as a single entity by users and applications.
Files have file names and may be created and deleted.
Access control restrictions usually apply at the file level. That is, in a
shared system, users and programs are granted or denied access to entire
files.
In some more sophisticated systems, such controls are enforced at the
record or even the field level.
Some file systems are structured only in terms of fields, not records. In
that case, a file is a collection of fields.
Database
A database is a collection of related data.
A database may contain all of the information related to an
organization or project, such as a business or a scientific
study.
The database itself consists of one or more types of files.
Usually, there is a separate database management system
that is independent of the operating system, although that
system may make use of some file management programs.
File Structure
Typical operations that must be supported include the
following:
Retrieve_All : Retrieve all the records of a file. This
will be required for an application that must process all
of the information in the file at one time.
For example, an application that produces a summary of
the information in the file would need to retrieve all
records.
File Structure
Retrieve_One : This requires the retrieval of just a
single record.
transaction-oriented applications need this operation.
Retrieve_Next : This requires the retrieval of the
record that is “next” in some logical sequence to the
most recently retrieved record.
A program that is performing a search may also use
this operation.
File Structure
Retrieve_Previous : Similar to Retrieve_Next , but
in this case the record that is “previous” to the
currently accessed record is retrieved.
1. Linux
2. macOS
3. Microsoft Windows