File Management and Organization: Adil Yousif, PHD
File Management and Organization: Adil Yousif, PHD
Organization
Lecture 1
Course Outlines
The Course will cover the following materials:
File concepts,
Basic file operations,
Physical file organization techniques,
Sequential file structures,
Hashing and direct organization structures,
Indexed structures,
List file structures (inverted, multi-key, ect.),
Tree structures (B trees, B+ trees,... etc.),
External sorting techniques,
Searching techniques.
2
Objectives of The Course
5
Textbooks
Course Evaluations
Written or programming assignments (20%)
A Mid-Term (20%)
A Final Exam (60%)
7
Course Web page:
Motivation
CENG 351 9
Data Structures vs. File Structures
Both involve:
Representation of Data
+
Operations for accessing data
Difference:
Data structures: deal with data in main memory
File structures: deal with data in secondary storage
CENG 351 10
Where do File Structures fit in
Computer Science?
11
Application
DBMS
File system
Operating System
Hardware
CENG 351
Computer Architecture
- Fast, expensive,
data is manipulated Main Memory (RAM)
volatile, small
here
data transfer
- disks, tape
data is
stored here Secondary - Slow,cheap,
Storage stable, large
CENG 351 12
Advantages
15
11/19/20
Memory Hierarchy
17
How fast is main memory?
Typical time for getting info from:
Main memory: ~12 nanosec = 120 x 10-9 sec
Magnetic disks: ~30 milisec = 30 x 10-3 sec
CENG 351 18
Normal Arrangement
CENG 351 19
Why Study File Structure Design?
How Can Secondary Storage Access Time be
Improved?
By improving the File Structure.
11/19/20
Goal of the file structures
CENG 351 21
Fixed versus Dynamic Files
22
11/19/20
Physical Files and Logical Files
physical file: a collection of bytes stored on a disk or
tape
logical file: a "channel" (like a telephone line) that
connects the program to a physical file
The program (application) sends (or receives) bytes to
(from) a file through the logical file.
The program knows nothing about where the bytes go
(came from).
The operating system is responsible for associating a
logical file in a program to a physical file in disk or
tape.
Writing to or reading from a file in a program is done
through the operating system.
CENG 351 23
Files
The physical file has a name, for instance
myfile.txt
The logical file has a logical name (a varibale) inside
the program.
In C :
FILE * outfile;
In C++:
fstream outfile;
CENG 351 24
Definition
11/19/20
Basic File Processing Operations
Opening
Closing
Reading
Writing
Seeking
CENG 351 26
File Systems
CENG 351 27
Example
A student file may be a collection of student
records, one record for each student
Each student record may have several fields,
such as
Name
Address
Student number
Gender
Age
GPA
CENG 351 29
Questions