Files Management – The interfacing

Slides:



Advertisements
Similar presentations
Chapter 4 : File Systems What is a file system?
Advertisements

Chapter 10: File-System Interface
1 Chapter 11: File-System Interface  File Concept  Access Methods  Directory Structure  File System Mounting  File Sharing  Protection  Chapter.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
File Management Chapter 12. File Management A file is a named entity used to save results from a program or provide data to a program. Access control.
Chapter 10: File-System Interface
File System Interface CSCI 444/544 Operating Systems Fall 2008.
Dr. Kalpakis CMSC 421, Operating Systems. Fall File-System Interface.
10: File Systems1 FILE SYSTEMS INTERFACE FILE CONCEPT A collection of related bytes having meaning only to the creator. The file can be "free formed",
File Systems. 2 Storing Information Applications can store it in the process address space Why is it a bad idea? –Size is limited to size of virtual address.
1 Operating Systems Chapter 7-File-System File Concept Access Methods Directory Structure Protection File-System Structure Allocation Methods Free-Space.
1 File Systems Chapter Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems.
Ceng Operating Systems
6/24/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 10: File-System Interface File Concept.
1 Friday, July 07, 2006 “Vision without action is a daydream, Action without a vision is a nightmare.” - Japanese Proverb.
File Concept l Contiguous logical address space l Types: Data: numeric, character, binary Program: source, object (load image) Documents.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10: File-System Interface.
Chapter 10 File System Interface
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Computer Studies (AL) File Management File system interface.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 10-1: File Systems Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 10: File-System Interface.
Silberschatz, Galvin and Gagne  Operating System Concepts File Concept Contiguous logical address space Smallest user allocation Non-volatile.
File Systems Long-term Information Storage Store large amounts of information Information must survive the termination of the process using it Multiple.
Chapter 10: File-System Interface 10.1 Silberschatz, Galvin and Gagne ©2011 Operating System Concepts – 8 th Edition 2014.
File Systems CSCI What is a file? A file is information that is stored on disks or other external media.
File System Interface. File Concept Access Methods Directory Structure File-System Mounting File Sharing (skip)‏ File Protection.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
Chapter 11 File Systems and Directories. 2 File Systems File: A named collection of related data. File system: The logical view that an operating system.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
Operating Systems COMP 4850/CISG 5550 File Systems Files Dr. James Money.
File Management Chapter 12. File Management File management system is considered part of the operating system Input to applications is by means of a file.
Module 4.0: File Systems File is a contiguous logical address space.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 11: File-System Interface File Concept Access Methods Directory Structure.
CE Operating Systems Lecture 17 File systems – interface and implementation.
Why Do We Need Files? Must store large amounts of data. Information stored must survive the termination of the process using it - that is, be persistent.
Annotated by B. Hirsbrunner File Systems Chapter Files 5.2 Directories 5.3 File System Implementation 5.4 Security 5.5 Protection Mechanism 5.6 Overview.
14.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 10 & 11: File-System Interface and Implementation.
It consists of two parts: collection of files – stores related data directory structure – organizes & provides information Some file systems may have.
Operating Systems 1 K. Salah Module 4.0: File Systems  File is a contiguous logical address space (of related records)  Access Methods  Directory Structure.
Chapter 11 File Systems and Directories. 2 File Systems (Chapter 11.1) File: 1. A named collection of related data. 2.smallest amount of information that.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally FILE SYSTEM.
SVBIT SUBJECT:- Operating System TOPICS:- File Management
Lecture : chapter 9 and 10 file system 1. File Concept A file is a collection of related information defined by its creator. Contiguous logical address.
File-System Management
File System Interface CSSE 332 Operating Systems
Module 11: File Structure
Chapter 11: File System Implementation
Indexing and hashing.
Chapter 12 File Management
File Management Computer can store information on storage media such as magnetic disks, tape and so on. The physical storage is converted into logical.
Module 10: File-System Interface
Chapter 11: File-System Interface
Operating Systems (CS 340 D)
CS510 Operating System Foundations
Chapter 11: File-System Interface
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Secondary Storage Management Brian Bershad
Chapter 10: File-System Interface
File-System Interface
Chapter 16 File Management
Management From the memory view, we can list four important tasks that the OS is responsible for ; To know the used and unused memory partitions To allocate.
Secondary Storage Management Hank Levy
Module 10: File-System Interface
Department of Computer Science
Lecture 4: File-System Interface
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Files Management – The interfacing The computer applications consists of programs and data. These programs and data must be in the main memory on execution. But when these programs and data are not in use, they will be saved on the secondary memory such as the hard disk, DVD, Flash ,.. etc. The part of the OS that will be responsible for managing the used and unused spaces on these secondary memory, is called the files manager. In this chapter, we will study the followings: The meaning of the file and the methods of naming it. The access methods to the data in these files The structures of the files and the directories How to share the files How to protect the files All these points will be studied from the view of the user, in other words how the users see and use the files. For this reason we call this chapter the interfacing .

The file: is a structure that contains information The file: is a structure that contains information. This information could be any type of data or programs used by the computer system. Each file has a name, and by this name the OS and other processes can deal with that file. File name: The file name is a unique string of characters that identify the file. Most of the operating systems allow the file name to have two parts. The first part is the main name of the file while the second part is the extension of the file. For example, test.java, prg.asm, mesg.doc,...etc. Some OS may allow the file name to be three parts. For example, proc.c.zip. Here the file name is proc and it is of C program type and it is compressed file. The file name may consist of letters , numbers , and special characters, this also depends on the roles of the OS. For example the UNIX recognizes between the upper and lower letters while the WINDOWS not. Also, some OS allow to use different language within the same file name. Figure in slide no. 3 shows different file names types.

Examples for Different file names

File structure: The structure of the file means how the data is organized within the file. The OS is responsible for how to structure the file and also the operations that implemented on these structures. However, three main types of structures are shown in the figure of slide no. 5. These structures can explained below: Unstructured sequence of bytes : In this type of structures ,the data of the file is organized in just a sequence of bytes without any difference between its parts. It is the responsibility of the application that creates this file to understand the meaning of the contents of the file. Sequence of fixed records: In this type of structures, the file is organized as a sequence of records. And each record consists of fields. The reading and writing operations are done with each record separately. 3) Tree of records: In this type of structures, the file is organized in a tree of variable size records. Each record has a header field called key field. The records in the tree will be arranged according to the key field, that is to make the search operation within the file more easy and more speed.

Some types of file structures

File Access To use the information stored in the file, we need to bring this information into the main memory. Different methods are used to access the file and deals with it’s contents. Below are some of these methods: Sequential access method Direct access method Indexed access method Sequential access method : This method expresses the simplest way to access the file. The records of the file, in this method can be accessed in sequence from one to the next. For example, if we are in record no. 2 and we want to read record no. 5 then we must move the file pointer from record 2 to 3 to 4 then to 5 and so on. In the same way to write in the file, the pointer is moved in sequence until reaching the end of the file then we add the new data and then the OS defines a new file’s end. Also , in this method the OS can rewind the storage media to return to the beginning of the file. Figure below shows an idea about this method. The tape is typical device that works basing on this method.

Direct access method : This method depends on the features of the floppy disk or the hard disk, that works on the principle of the random access. So any record on the disk can be reached directly without the need to move the file pointer in sequence. For example, we can reach from record 6 to record 18 then return to record 2 by moving the read/write head to the locations of these records directly. This access method is more effieceint and faster than the sequence access. The figure below shows a simple structure for the disk storage and how the direct access method is implemented . Surface Truck Sector Read/Write head

The indexed access method: In this method, each record in the file has a key. At the same time there is a data structure that contains indexed entries. Each entry consists of a key value and a pointer to the related record .So, when a record is wanted, the OS will search the indexed list according to the key of the record, and then use the pointer to go directly to the record location. Figure below shows the idea behind the indexed access method. .... Record location Key 1 pointer1 Key2 pointer2 Key3 pointer3 . . Keyn pointern search

Even the indexed access method is more secure since each record has a key that used to deal with the content of that record, but the problem is size of the indexed list that increases proportionally with the size of the file size. So this will cause burden on the main memory. One solution to solve this problem is to build two lists; a small primary indexed list and a secondary indexed list. The OS will search in three levels to find the location of the wanted record as shown in the figure below. At first level, the OS will bring and search within the primary indexed list to find the address of the part (block) in the secondary indexed list. At the second level, the OS will bring and search within this block to find the address ( location) of the block that contains the wanted record ( actual data). At the third level, the OS will bring and search within the data block to find the wanted record. This method is called Indexed Sequential access method

File Attributes : The name of the file is not enough to deal with that file, since there are a lot of attributes which accompany the file in addition to it’s name. Generally, the main attributes can be listed as below: File name File pointer ( some times called Identifier) Data about where the file is stored in the secondary memory File size Protection access information Dates and times of creation and updating the file We must mention here, that to reach to the different attributes and the contents of the file, some OS work as the figure shown below: . File name pointer (Id number) Data Structure containing the attributes Directory structure Location of the file on the secondary storage

File operations: The OS offers many operations on the files, such as : Create a file Open a file Delete a file Read a file Write a file Close a file Seek in a file Append to a file Lock a file others...

Directory Structure: the file system may contains millions of files Directory Structure: the file system may contains millions of files. So, a well organization of these files on the secondary memory must be achieved. The OS does that on two stages. The first stage is to divide the disk into partitions (volumes) . Some OS divide one disk into more than one partition and others allow one than one disk to work as one partition. In the second stage the OS will build a data structure called directory for each partition. This directory contains information ( attributes) such as name, size, location,...etc about the files that stored in the related partition. The figure below shows a typical example for the organization of the disks as partitions.

Types of Directory Structures As we said the directory is used to organize and manage the file system. The OS offers many operations that can be used with the structure of the directory. For example , add an entry for a file when that file is created , delete an entry of a file when that file is deleted , searching for an entry of a file, and so on. Regardless of the operations on the directories, there are different ways to design these directories, below is a list for the important types of the directory structures: Single level directory structure Two level directory structure Tree structured directory Acyclic directory structure

Single level directory structure: This type of structures is the simplest one. It is just a set of entries as shown in the figure below. Each entry belongs to a file and contains the file name , the attributes and the addresses of the file locations on the secondary memory. The disadvantage of this structure is the repetition of the file names. For example two users give their files the same name. Another example, when one user likes to give the same name for two files.

Two level directory structure: In this structure there are two levels Two level directory structure: In this structure there are two levels. The first level which is called the Master File Directory This directory will contain set of entries, where each entry represents one user and has a pointer to a directory in the second level. In the second level, there are a directory dedicated for each user which is called User File Directory. So, the OS needs to know the file and it’s owner, So it can find that file by searching through the two levels as shown in the figure below.

Tree structured directory: This structure is the most common today Tree structured directory: This structure is the most common today. In this structure, there is main directory called the root directory. And from this root, the user can build his own tree structure which consists of subdirectories and files as shown in the figure below. So, each file has it’s own unique path through the tree.

Acyclic directory structure: This structure is an extension of the tree structure. Since this structure allows to share directories and files. The shared file is in fact one real copy. And any changes in the file can be seen by all beneficiary users. Also we can see that the shared file may have more than path through the tree. All these principles can be seen in the figure below.