0% found this document useful (0 votes)
236 views13 pages

MODULE-5 FILE & Their Organization

This document discusses different types of file organization and attributes. It defines key terms like data hierarchy, records, files, and databases. It describes different file attributes like read-only and hidden. It also explains different file organizations like sequential, relative, and indexed sequential. Sequential organization stores records sequentially for efficient processing of large amounts of data. Relative organization allows direct access to records using their relative position. Indexed sequential combines sequential and relative organizations.

Uploaded by

Ral Ralte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
236 views13 pages

MODULE-5 FILE & Their Organization

This document discusses different types of file organization and attributes. It defines key terms like data hierarchy, records, files, and databases. It describes different file attributes like read-only and hidden. It also explains different file organizations like sequential, relative, and indexed sequential. Sequential organization stores records sequentially for efficient processing of large amounts of data. Relative organization allows direct access to records using their relative position. Indexed sequential combines sequential and relative organizations.

Uploaded by

Ral Ralte
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

FILE AND THEIR ORGANIZATION

Data Hierarchy
Def: Data is a representation of facts or concepts in an
organized manner. The systematic organization of data
refers to data hierarchy.
Data hierarchy involves various data items such as:
➢Field/ Attributes: A data filed is an elementary unit
of information that stores a single fact or an attribute.
Ex: Name of student, usn, phn num etc..
➢Record: A record is collection of related data fields.
Ex: a student record containing various data fields.
File and their Organization
➢Data Hierarchy
➢File Attributes
➢Text Files and Binary Files
➢Basic File Operations
➢File Organizations and Indexing
➢File: A file is a collection of related records.
Ex: file for each student consisting of stu’d academic
record, personal record hostel record etc..

➢Data Base: is a data structure that stores organized


information usually in the form of tabular columns.
Ex: Student file consisting of various fileds
File Attributes
Def: File attributes are settings that are associated with
computer files. These attributes may grant or deny certain
rights to the user or the OS when a file is accessed.
Various file attributes supported by windows or DOS:
▪ Read-only
▪ Hidden
▪ System
▪ Directory- When a directory bit is set, the name associated
with file is considered a directory or sub-directory which
contains files.
▪ Archive-A archive bit is set when s file is modified. So, when
archive bit is set, it is ready for backup. After backup is over,
archive bit is cleared.
Text Files
Def: A text file is standard text document that contains only
the text made up of letters A through Z including lower
case letters, digits from 0 to 9 and Special symbols such as
+, -. *, (,) etc..
▪ Special formatting such as bold, italic images etc.. Are not
supported for a text file. Since it is an ASCII file, each
character in the file is stored using ASCII code.
Binary Files
Def: A file that is stored in binary form(i.e., o and 1’s) in
memory is called binary files.
▪ All executable files are binary files.
Basic File Operations
➢Creation : A file has to be opened in write mode to
create a file. Data read from other file or the input
device can be written into the file.
➢Updating file: A file must be opened for updating
using “r+” mode.
➢Retrieval : It is the process of extracting useful
information from a file.
➢Maintenance: It involves re-organization of file
contents without changing the contents of the file.
➢It is used only for structural changes such as
increasing the filed width or adding the fields for
specific purpose or deleting the unused fields.
File Organization
Def: The method of storing files in memory in certain
order so that the insertion or deletion or modification
will be faster and efficient there by increasing the
performance of the system is called file organization.
Objectives of file organization:
➢ Records should be accesses as faster as possible.
➢ Any insertion, updation or deletion should be easy and
fast without affecting other records.
➢ Records should be stored such that cost of storage is
minimal and should be efficient.
File Organization techniques used in file
organization:
➢Sequential file organization
➢Relative file organization
➢Indexed sequential file organization

Sequential file organization


▪ Records are stored one after the other in a sequential
manner.
▪ They generally used to generate report or In a payroll
processing of all the employees in an organization.
Advantages of sequential file organization
➢ Design is very simple and easy to handle
➢ No much effort involved to store the data.
➢ When large amount of data has to be processed, it is very efficient.
This is very useful when all the records are used for calculation
purposes such as generating the salary slips.
➢ The files can be stored on magnetic disks and tapes which are
relatively cheap.

Disadvantages of sequential file organization


➢ Records are read only sequentially.
➢ If the sorted files are used, they involve more effort as every
updating requires sorting of the files.
Relative file organization/Random access file
organization/ Direct access file organization
➢In this technique, records of the file are stored
one after the other both physically and logically.
Ex: A record with sequence number 6 is physically located and placed after
record 5.
All records are identified by their position relative to the beginning of
the file i.e., the records namely record 0, record 2 etc.. Are accessed
using relative positions 0,1 and so on.
Any record can be read just by specifying the key value.
Address of ith record=base address + (i-1) * w, w-length of record
Advantages
▪ We can access the desired record immediately
▪ Processing or accessing of the records is easier.
▪ New records can be added very easily in free locations based on the
relative record number of the record to be inserted.
▪ Updating the records is very easy

Disadvantages
▪ Records should be of fixed length only
▪ The relative position of the record must be known before processing.
Indexed sequential file organization
It uses the concept of both sequential as well as
relative files.
Advantages
▪ Searching an element is easy
▪ Records can accessed sequentially and randomly

Disadvantage
▪ They can be stored only on disks
▪ Its requires extra storage space for storing indices
▪ Support only fixed length records

You might also like