SlideShare a Scribd company logo
1
Fundamental File Structure
Concepts & Managing Files of
Records
2
Outline I: Fundamental File
Structure Concepts
• Stream Files
• Field Structures
• Reading a Stream of Fields
• Record Structures
• Record Structures that use a length
indicator
3
Outline II: Managing Files of
Records
• Record Access
• More About Record Structures
• File Access and File Organization
• More Complex File Organization and
Access
• Portability and Standardization
4
Field and Record Organization:
Overview
• The basic logical unit of data is the field which
contains a single data value.
• Fields are organized into aggregates, either as
many copies of a single field (an array) or as a list
of different fields (a record).
• When a record is stored in memory, we refer to it
as an object and refer to its fields as members.
• In this lecture, we will investigate the many ways
that objects can be represented as records in files.
5
Stream Files
• Mary Ames
• 123 Maple
• Stillwater, OK 74075
• Alan Mason
• 90 Eastgate
• Ada, OK 74820
n Stream Files, the information is written as a
eam of bytes containing no added information:
mesMary123 MapleStillwaterOK74075MasonAlan90 EastgateAdaOK7
Problem: There is no way to get the information
ck in the organized record format.
6
Field Structures
• There are many ways of adding structure to
files to maintain the identity of fields:
– Force the field into a predictable length
– Begin each field with a length indicator
– Use a “keyword = value” expression to
identify each field and its content.
7
Reading a Stream of Fields
• A Program can easily
read a stream of fields
and output ===>
• This time, we do
preserve the notion of
fields, but something
is missing: Rather than
a stream of fields,
these should be two
records
Last Name: ‘Ames’
First Name: ‘Mary’
Address: ‘123 Maple’
City: ‘Stillwater
State: ‘OK’
Zip Code: ‘74075’
Last Name: ‘Mason’
First Name: ‘Alan’
Address: ‘90 Eastgate’
City: ‘Ada’
State: ‘OK’
Zip Code: ‘74820’
8
Record Structure I
• A record can be defined as a set of fields
that belong together when the file is viewed
in terms of a higher level of organization.
• Like the notion of a field, a record is
another conceptual tool which needs not
exist in the file in any physical sense.
• Yet, they are an important logical notion
included in the file’s structure.
9
Record Structures II
• Methods for organizing the records of a file include:
– Requiring that the records be a predictable number
of bytes in length.
– Requiring that the records be a predictable number
of fields in length.
– Beginning each record with a length indicator
consisting of a count of the number of bytes that
the record contains.
– Using a second file to keep track of the beginning
byte address for each record.
– Placing a delimiter at the end of each record to
separate it from the next record.
10
Record Structures that Use a
Length Indicator
• The notion of records that we implemented are
lacking something: none of the variability in the
length of records that was inherent in the initial
stream file was conserved.
• Implementation:
– Writing the variable-length records to the file
– Representing the record length
– Reading the variable-length record from the
file.
11
Record Access: Keys
• When looking for an individual record, it is
convenient to identify the record with a key
based on the record’s content (e.g., the
Ames record).
• Keys should uniquely define a record and
be unchanging.
• Records can also be searched based on a
secondary key. Those do not typically
uniquely identify a record.
12
Sequential Search
• Evaluating Performance of Sequential
Search.
• Improving Sequential Search Performance
with Record Blocking.
• When is Sequential Search Useful?
13
Direct Access
• How do we know where the beginning of the
required record is?
It may be in an Index (discussed in a different
lecture)
We know the relative record number (RRN)
• RRN are not useful when working with variable
length-records: the access is still sequential.
• With fixed-length records, however, they are
useful.
14
Record Structure
• Choosing a Record Structure and Record Length
within a fixed-length record. 2 approaches:
– Fixed-Length Fields in record (simple but
problematic).
– Varying Field boundaries within the fixed-
length record.
• Header Records are often used at the beginning of
the file to hold some general info about a file to
assist in future use of the file.
15
File Access and File
Organization: A Summary
• File organization depends on what use you want to
make of the file.
• Since using a file implies accessing it, file access
and file organization are intimately linked.
• Example: though using fixed-length records
makes direct access easier, if the documents have
very variable lengths, fixed-length records is not a
good solution: the application determines our
choice of both access and organization.
16
Beyond Record Structure
• Abstract Data Models for File Access
• Headers and Self-Describing File
• Metadata
• Color Raster Images
• Mixing Object Types in One File
• Representation-Independent File Access
• Extensibility
17
Portability and Standardization
• Factors Affecting Portability
– Differences among Operating Systems
– Differences among Languages
– Differences in Machine Architectures
• Achieving Portability
– Agree on a Standard Physical Record Format and Stay
with it
– Agree on a Standard Binary Encoding for Data Elements
– Number and Text Conversion
– File Structure Conversion
– File System Differences
– Unix and Portability

More Related Content

PPTX
Design Pattern
PPT
Process Improvement in Software Engineering SE25
DOCX
Report hospital
PPT
DFS-Lecture-6 (3).ppt
PPT
Unit 3 chapter-1managing-files-of-records
PPTX
Chapter 12.pptx
PPTX
Mca ii dfs u-5 sorting and searching structure
PPTX
File Management
Design Pattern
Process Improvement in Software Engineering SE25
Report hospital
DFS-Lecture-6 (3).ppt
Unit 3 chapter-1managing-files-of-records
Chapter 12.pptx
Mca ii dfs u-5 sorting and searching structure
File Management

Similar to Fundamental file structure concepts & managing files of records (20)

PPTX
Bca ii dfs u-4 sorting and searching structure
PPTX
Bsc cs ii dfs u-4 sorting and searching structure
PPTX
File Organization
PPTX
CHAPTER 1 - Operating systems File System Interface.pptx
PPTX
DBMS Data Storage and Query Processing.
PPTX
UNIT7-FileMgmt.pptx
PPT
Chapter 3 part 1
PDF
File Types in Data Structure
PPT
Introduction to the design and specification of file structures
PPTX
storage techniques_overview-1.pptx
PPTX
File organization
PPTX
Model of file system
PPTX
File Management
PDF
Files and data storage
PPTX
Ch 17 disk storage, basic files structure, and hashing
PDF
Database management system chapter thirt
PPTX
FILE MANAGEMENT.pptx
PDF
File organisation
PPTX
File System.pptx
PPTX
Elmasri Navathe Primary Files database A
Bca ii dfs u-4 sorting and searching structure
Bsc cs ii dfs u-4 sorting and searching structure
File Organization
CHAPTER 1 - Operating systems File System Interface.pptx
DBMS Data Storage and Query Processing.
UNIT7-FileMgmt.pptx
Chapter 3 part 1
File Types in Data Structure
Introduction to the design and specification of file structures
storage techniques_overview-1.pptx
File organization
Model of file system
File Management
Files and data storage
Ch 17 disk storage, basic files structure, and hashing
Database management system chapter thirt
FILE MANAGEMENT.pptx
File organisation
File System.pptx
Elmasri Navathe Primary Files database A
Ad

More from Devyani Vaidya (20)

PPT
PPT
Cosequential processing and the sorting of large files
PPTX
Mobile Phone Cloning
PPTX
Data warehousing
PPTX
secued cloud
PPTX
Cloud Cmputing Security
PPTX
Cloud Security
PPTX
Wireless network
PPT
Environmental law
PPTX
Wireless mobile charging using microwaves
PPTX
Secure Cloud Issues
PPTX
Energy Harvesing Through Reverse Electrowetting
PPT
Wireless Charging Of Mobile
PPTX
Applet programming
PPTX
Seminar on telephone directory
PPTX
History of Laptop
PPTX
Ppt on open and close door using Applet
PPTX
Resource management
PPTX
Ppt on use of biomatrix in secure e trasaction
PPTX
Secued Cloud
Cosequential processing and the sorting of large files
Mobile Phone Cloning
Data warehousing
secued cloud
Cloud Cmputing Security
Cloud Security
Wireless network
Environmental law
Wireless mobile charging using microwaves
Secure Cloud Issues
Energy Harvesing Through Reverse Electrowetting
Wireless Charging Of Mobile
Applet programming
Seminar on telephone directory
History of Laptop
Ppt on open and close door using Applet
Resource management
Ppt on use of biomatrix in secure e trasaction
Secued Cloud
Ad

Recently uploaded (20)

PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharma ospi slides which help in ospi learning
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Computing-Curriculum for Schools in Ghana
PDF
Complications of Minimal Access Surgery at WLH
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Insiders guide to clinical Medicine.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPH.pptx obstetrics and gynecology in nursing
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O5-L3 Freight Transport Ops (International) V1.pdf
Pharma ospi slides which help in ospi learning
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
102 student loan defaulters named and shamed – Is someone you know on the list?
STATICS OF THE RIGID BODIES Hibbelers.pdf
human mycosis Human fungal infections are called human mycosis..pptx
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Computing-Curriculum for Schools in Ghana
Complications of Minimal Access Surgery at WLH
Supply Chain Operations Speaking Notes -ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
Anesthesia in Laparoscopic Surgery in India
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Insiders guide to clinical Medicine.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf

Fundamental file structure concepts & managing files of records

  • 1. 1 Fundamental File Structure Concepts & Managing Files of Records
  • 2. 2 Outline I: Fundamental File Structure Concepts • Stream Files • Field Structures • Reading a Stream of Fields • Record Structures • Record Structures that use a length indicator
  • 3. 3 Outline II: Managing Files of Records • Record Access • More About Record Structures • File Access and File Organization • More Complex File Organization and Access • Portability and Standardization
  • 4. 4 Field and Record Organization: Overview • The basic logical unit of data is the field which contains a single data value. • Fields are organized into aggregates, either as many copies of a single field (an array) or as a list of different fields (a record). • When a record is stored in memory, we refer to it as an object and refer to its fields as members. • In this lecture, we will investigate the many ways that objects can be represented as records in files.
  • 5. 5 Stream Files • Mary Ames • 123 Maple • Stillwater, OK 74075 • Alan Mason • 90 Eastgate • Ada, OK 74820 n Stream Files, the information is written as a eam of bytes containing no added information: mesMary123 MapleStillwaterOK74075MasonAlan90 EastgateAdaOK7 Problem: There is no way to get the information ck in the organized record format.
  • 6. 6 Field Structures • There are many ways of adding structure to files to maintain the identity of fields: – Force the field into a predictable length – Begin each field with a length indicator – Use a “keyword = value” expression to identify each field and its content.
  • 7. 7 Reading a Stream of Fields • A Program can easily read a stream of fields and output ===> • This time, we do preserve the notion of fields, but something is missing: Rather than a stream of fields, these should be two records Last Name: ‘Ames’ First Name: ‘Mary’ Address: ‘123 Maple’ City: ‘Stillwater State: ‘OK’ Zip Code: ‘74075’ Last Name: ‘Mason’ First Name: ‘Alan’ Address: ‘90 Eastgate’ City: ‘Ada’ State: ‘OK’ Zip Code: ‘74820’
  • 8. 8 Record Structure I • A record can be defined as a set of fields that belong together when the file is viewed in terms of a higher level of organization. • Like the notion of a field, a record is another conceptual tool which needs not exist in the file in any physical sense. • Yet, they are an important logical notion included in the file’s structure.
  • 9. 9 Record Structures II • Methods for organizing the records of a file include: – Requiring that the records be a predictable number of bytes in length. – Requiring that the records be a predictable number of fields in length. – Beginning each record with a length indicator consisting of a count of the number of bytes that the record contains. – Using a second file to keep track of the beginning byte address for each record. – Placing a delimiter at the end of each record to separate it from the next record.
  • 10. 10 Record Structures that Use a Length Indicator • The notion of records that we implemented are lacking something: none of the variability in the length of records that was inherent in the initial stream file was conserved. • Implementation: – Writing the variable-length records to the file – Representing the record length – Reading the variable-length record from the file.
  • 11. 11 Record Access: Keys • When looking for an individual record, it is convenient to identify the record with a key based on the record’s content (e.g., the Ames record). • Keys should uniquely define a record and be unchanging. • Records can also be searched based on a secondary key. Those do not typically uniquely identify a record.
  • 12. 12 Sequential Search • Evaluating Performance of Sequential Search. • Improving Sequential Search Performance with Record Blocking. • When is Sequential Search Useful?
  • 13. 13 Direct Access • How do we know where the beginning of the required record is? It may be in an Index (discussed in a different lecture) We know the relative record number (RRN) • RRN are not useful when working with variable length-records: the access is still sequential. • With fixed-length records, however, they are useful.
  • 14. 14 Record Structure • Choosing a Record Structure and Record Length within a fixed-length record. 2 approaches: – Fixed-Length Fields in record (simple but problematic). – Varying Field boundaries within the fixed- length record. • Header Records are often used at the beginning of the file to hold some general info about a file to assist in future use of the file.
  • 15. 15 File Access and File Organization: A Summary • File organization depends on what use you want to make of the file. • Since using a file implies accessing it, file access and file organization are intimately linked. • Example: though using fixed-length records makes direct access easier, if the documents have very variable lengths, fixed-length records is not a good solution: the application determines our choice of both access and organization.
  • 16. 16 Beyond Record Structure • Abstract Data Models for File Access • Headers and Self-Describing File • Metadata • Color Raster Images • Mixing Object Types in One File • Representation-Independent File Access • Extensibility
  • 17. 17 Portability and Standardization • Factors Affecting Portability – Differences among Operating Systems – Differences among Languages – Differences in Machine Architectures • Achieving Portability – Agree on a Standard Physical Record Format and Stay with it – Agree on a Standard Binary Encoding for Data Elements – Number and Text Conversion – File Structure Conversion – File System Differences – Unix and Portability