File Processing : File Organization and File Systems - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

File Processing : File Organization and File Systems

Description:

Binary Large Object Block (BLOB) If size (field) size (block) e.g. Image or Video. BLOB : Type of field where its size is greater than block size. cf. ... – PowerPoint PPT presentation

Number of Views:384
Avg rating:3.0/5.0
Slides: 17
Provided by: lik
Category:

less

Transcript and Presenter's Notes

Title: File Processing : File Organization and File Systems


1
File Processing File Organization and File
Systems
  • 2008, Spring
  • Pusan National University
  • Ki-Joune Li

2
Logical Structure of File
File
Field
Field
Field
Record (Tuple)
Record
Record
Block
3
Fixed Size Record
  • Fixed Size
  • Fixed Number of Fields, and
  • Fixed Size of each Field
  • Easy to implement
  • Disk Address
  • (n-1)srecord
  • Deletion of a record
  • Like Array but no movement
  • Free Record List or
  • Pointer to Next Record

4
Variable Length Record
  • Variable Length due to
  • Variable Number of Fields, or
  • Variable Size of each Field
  • Complicated to implement
  • Implementation
  • Delimiter (, size, or pointer)
  • Slotted Page
  • Fixed Length
  • Overflow Area
  • Reserved Space

5
Delimiters
Record
Record

Record
Record
Record

Record
  • Difficult to handle deletions and insertions

6
Slotted Page
  • Records can be moved around within a page
  • to keep them contiguous with no empty space
    between them
  • entry in the header must be updated.
  • Pointers should not point directly to record
  • But to the entry for the record in header.

7
Reserved Space
8
Overflow Area
9
Binary Large Object Block (BLOB)
  • If size (field) gt size (block)
  • e.g. Image or Video
  • BLOB Type of field where its size is greater
    than block size
  • cf. CLOB Text rather than binary

Name
ID
Photo
10
File System
  • Example
  • fdopen(data.txt,O_RDONLY,0)
  • Nbytesread(fd,buf,100)
  • ? How to process these functions in OS ?

11
i (index)node information about file
Name
Type directory, data, special
Permission
Ownership
Last updated date/time
Created date/time
12
i-node Pointer to data block
Attributes
Pointers to data block (0-9 up to 40K bytes)
Single direct Pointer
Double direct Pointer
13
Block configuration for i-node
Boot Block
0
Reserved Block
Super Block
1
User space
14
Implementation of File Hierarchy
i-node for root directory
i-node for /usr
i-node for /usr/lik
15
FAT (File Allocation Table)
  • DOS or MS-Windows 98
  • Same purpose of i-node in UNIX

16
fdopen(data.txt,O_RDONLY,0)Nbytesread(fd,buf
,100)
  • Step 1 Find i-node for data.txt via i-node
  • from root or current directory
  • Step 2 Check owner and access right
  • Step 3 Register it to OpenFileTable
  • Initialize entry values e.g. offset, mode
  • fd array index of this table
  • Some entries reserved for stdio, stderr, etc..
  • Step 4 Check ownership and right
  • Step 5 Read 100 bytes to buf
  • Read 100 bytes from the OpenFileTablefd.offset
  • OpenFileTablefd.offset 100
Write a Comment
User Comments (0)
About PowerShow.com