1 | Page with our best wishes Dr. Ayman Elshenawy File Organization Sheet 1. What is a File? A collection of data is placed under permanent or non-volatile storage Examples: anything that you can store in a disk, hard drive, tape, optical media, and any other medium which doesn’t lose the information when the power is turned off. 2. Compare between Logical and physical files? Physical file: physically exists on secondary storage; known by the operating system; appears in its file directory Logical file, what your program actually uses, a ‘pipe’ though which information can be extracted, or sent. Type Physical File Logical File collection of bytes stored on a disk or tape A “Channel” (like a telephone line) that hides the details of the file’s location and physical format to the program 3. What is a Basic File System? A Basic File System (BFS) is the only software that interfaces directly with the peripheral devices attached to the system. The function of a basic file system is sometimes referred to as physical I/O. This is because it deals with the physical reading and writing of blocks of data on the peripheral devices. However, the BFS does not understand the content and meaning of the data being transferred. 4. Why Users and Computers Have a need for Basic File System? Users and computer systems need a BFS for the following reasons: To provide a common interface to perform block I/O.
13
Embed
File Organization Sheet - WordPress.com · File Organization Sheet 1. What is a File? ... Briefly describe the fundamental file processing operations ... processing. Delete File Operation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1 | P a g e w i t h o u r b e s t w i s h e s D r . A y m a n E l s h e n a w y
File Organization Sheet
1. What is a File?
A collection of data is placed under permanent or non-volatile storage
Examples: anything that you can store in a disk, hard drive, tape, optical
media, and any other medium which doesn’t lose the information when the
power is turned off.
2. Compare between Logical and physical files?
Physical file: physically exists on secondary storage; known by the
operating system; appears in its file directory
Logical file, what your program actually uses, a ‘pipe’ though which
information can be extracted, or sent.
Type Physical File Logical File
collection of
bytes stored on a disk or tape
A “Channel” (like a telephone line) that hides the details of the file’s
location and physical format to the program
3. What is a Basic File System?
A Basic File System (BFS) is the only software that interfaces directly with the
peripheral devices attached to the system. The function of a basic file system
is sometimes referred to as physical I/O. This is because it deals with the
physical reading and writing of blocks of data on the peripheral devices.
However, the BFS does not understand the content and meaning of the data
being transferred.
4. Why Users and Computers Have a need for Basic File System?
Users and computer systems need a BFS for the following reasons:
To provide a common interface to perform block I/O.
2 | P a g e w i t h o u r b e s t w i s h e s D r . A y m a n E l s h e n a w y
To provide a centralized control program to ensure that the devices
connected to the system are being allocated and scheduled properly.
To provide a central resource to ensure data integrity by providing error
recovery and exception handling for all users.
5. What are the Sources of File System inputs?
The data the BFS needs to perform its work must come from one of the
following sources:
• User Programs
• Command Language Files
• Job Control Languages (JCL), utilized at the user’s site a stand-alone utility
program that interactively request the data from the user. Such a program
can prompt the user for each of the required parameters, check inputs for
validity, and then store the information within the file itself.
3 | P a g e w i t h o u r b e s t w i s h e s D r . A y m a n E l s h e n a w y
6. What are the basic Functions of the Basic File System?
• The allocation of all space on the devices
• The centralization of all I/O through the BFS
• The control of the devices themselves, which usually requires a rather
detailed knowledge of device-specific details.
• The processing of all the I/O terminations to ensure that the correct
processing is performed. Also, it must then initiate the next I/O request
targeted for that device.
4 | P a g e w i t h o u r b e s t w i s h e s D r . A y m a n E l s h e n a w y
• Finally, upon completion of the user’s I/O request, the BFS must notify the
user as to whether the I/O request completed correctly. This is done by
returning a status field, which indicates how the I/O request terminated.
7. Briefly describe the fundamental file processing operations (write code
examples)?
Opening Files
code in C and C++ -> fd = open(filename, flags [, pmode]);
That makes the file ready to use by the program.
Closing Files
Files are usually closed automatically by the operating system (unless the
program is abnormally interrupted).
it Makes the logical file name available for another physical file.