File management in operating system

This tutorial covers the file concept in os and file management in operating system. In this tutorial we will learn about different types of files in operating system and different operations on file.

File management in operating system

What is file ?
What are different attributes of a file ?
What are different operation to perform on file?
What are types of file?

This tutorial covers the file concept in os and file management in operating system. In this tutorial we will learn about different types of files in operating system and different operations on file.

(A) What is file ?

Generally  a file is a collection of records. A file can also be defined as a named persistent sequential (structured) data repository. The basic idea behind the creation of a file is  that files can be used to store data for long periods of time, and specifically. 

 File as a collection of related information is recorded on the secondary storage like magnetic disk. Magnetic tape and optical disk.

(B) Attributes of file

Under this heading we will learn about different file attributes in os .File’s attributes vary from one operating system to another Operating System. But in general a File may have following file attributes in os.

Name : Every file has a name which is human readable.

Id: Id is a unique number which identifies the file within the file system, generally id is a non human readable name for a file.

Type: This information is needed for system that supports different types of files.

Location: This  attributes of a file is nothing but a information which is a pointer to a device and the location of the file on that device.

Size: Size of file can be defined in term of Bits, Bytes , words or block.

Protection : Protection attribute of file tell the information about the access control which means who can read, write and execute a file.

Time, date and user Identification :  This information may be kept for creation, last modification and last use. This information may be useful for protection, security, and usage monitoring.


file management in operating system

(C) Different operations on file

Here in this section I am going to tell about different file operation in os that can be performed on a file. These Operations are as follows:

Creation : There are two steps which are used to create a file. At first we need to find a space in the file system where we can store the file. Second step is that there should be an entry for the new file  in the directory.

Writing into a File: In Order to write something in  a file at first we make a system call specifying both the name of the file and the information to be written to the file. When we enter the name of the file then system searches the directory to find the file's location. 

The system must put a write pointer  in the file at a location where the next write is to take place. After writing in a file has been complete then writer pointer should be update.

Reading or Accessing a file: To read  or access the data from a file we use a system call that specifies the name of the file and where (in memory) the next block of the file should be place. Again, there is a search in the directory for the related entry and the file system needs to keep a read pointer which point the location in the file where the next read is to perform. 

Once the read operation has been completed the read pointer need to be update. Generally a process is usually either reading from or writing to a file, the current operation location can be kept as a per-process. Read and write operations use this same pointer for saving space and reducing system complexity. We will later describe different file access methods in operating system.

Re-position : To perform the re positioning within a file at first there is a directory correspond to the appropriate entry and the current-file-position pointer is re positioned to a given value. It should be remember that re positioning within a file does not  involve any actual I/0. This operation is also known as file seek.

Deletion:  To delete a file at first  directory is search for the file to be deleted. When the associated file  entry is found  then we release all file space, so that it can be reused by other files and erase the directory entry.

Truncation of a file :  There is difference between truncation of a file and deletion of file. Truncation is performed when user  may want to erase the contents of a file but keep its attributes. Instead of forcing the user to delete the file and then recreate it, this function allows all attributes to remain unchanged –except for file length-but lets the file be reset to length zero and its file space released.

(D) Types of File

different types of file in computer are as shown in following table.

file management in operating system



COMMENTS

Name

addressing modes types,1,advance-java,2,advancejava,1,aktu entrance exam,1,aktu exam schedule,1,ASP,1,bare machine,1,base register and limit register,1,C Programming,14,C Plus Plus,1,C Programming,3,C Programming MCQ,2,C Programming Questions,2,C programming study material for gate exam,12,Cache Memory,1,CBNST Program,1,Childcare,1,CJ,2,Cloud Computing,1,COA GATE Questions,1,components of use case diagram,1,Computer Architecture,2,Computer architecture based questions for gate exam,11,Computer Network,4,Computer Network Study Material,2,Computer network study material for gate,2,Computer Networks,6,Computer networks GATE Questions,1,Computer Science Study Material for Gate,19,computer science study material for gate exam,34,content based image retrieval content based image retrieval system,1,contiguous memory allocation,2,Core Java,8,COre Java Interview Questions,1,core java interviews questions,1,cyber crime report,1,Cyber crime status,1,cybercrime and security,1,cybercrime examples,1,Data Mining,1,Data Structure Questions,1,Data Transmission Architecture,1,Data Transmission in wsn,1,DBMS,5,dbms question paper,1,DE,1,Digital Electronics,1,DS,1,dynamic linking,1,dynamic linking in memory management,1,Dynamic memory allocation in c,1,Electroencephalogram,1,File Handling,1,file management in operating system notes,1,FOC,1,Fundamenatl of Computer,1,Gate 2017,5,Gate 2017 Admit card,1,Gate 2017 Exam Schedule,1,Gate 2017 Syllabus,1,gate 2018,1,gate cse study material,1,gate practice set,10,gate study material for computer science,16,Gate study material for computer science 2017,1,GatePreviousYear,1,General,3,HCL Aptitude Test,1,HR Interview Questions,1,HTML,1,Image Processing,1,Important Date of Gate 2017 Exam,1,Information Security Policy,1,internal and external fragmentation,1,JS,1,lagrange's interpolation formula,1,lagrange's interpolation formula examples,1,Looping in C,1,MComputing,1,memory fragmentation,1,memory management,1,memory management questions and answer in os,1,Motivational,4,NCER,2,Numerical Techniques Lab,1,OOT,1,Operating System,12,Operating System Gate Questions,1,Operating System Objective Questions,4,Operating System Questions Bank,1,Operating system questions for gate,1,Operating System Study material,2,operating system study material for gate exam,16,Operating system tutorial,2,page swapping,1,paged memory allocation,1,paged memory allocation in operating system,1,paging technique of memory management .paging technique,1,paging technique of memory management program in c,1,Pointer in C,4,Process based question for gate,1,Quiz on non conventional energy resources,1,Regression testing,1,relocation in memory management,1,relocation registe,1,relocation register,1,resident monitor,1,resident monitor in operating system,1,routing table,1,segmentation in memory management,1,segmentation in memory management in operating system,1,Servlet,1,session tracking,1,session tracking in java,1,session tracking in servlet,1,Software Engineering,10,Software Engineering baes study material for gate,1,software engineering interview questions,1,Software Quality Assurance,3,software verification methods,1,SPM,1,Structure in C,1,Study Material for gate Computer Science,9,swapping in memory management,1,swapping in operating system,1,TCS Code Vita,1,TCS Interview Questions,1,Technical Interview,1,Technical Questions from DBMS,1,Thrashing in Operating System,1,Threads concept in operating system,1,Tips to Learn Coding,1,Top 30 Core Java Interview Questions with Answer,2,top down approach,1,top down approach in programming,1,Types of operating system,1,UML,1,use case diagram explanation,1,website uses cookies,1,what is cookies website,1,What is process control block ?,1,what is software testing?,1,Wireless Sensor Network,3,worst fit algorithm for memory allocation,1,XML,1,
ltr
item
Computer Science Junction: File management in operating system
File management in operating system
This tutorial covers the file concept in os and file management in operating system. In this tutorial we will learn about different types of files in operating system and different operations on file.
https://2.bp.blogspot.com/-mp9qnSVQJh8/W9hcnyMwHII/AAAAAAAAA_8/3Gj2sdtDPJ4XaV6uWZ9SJNs5DIdpUHvqQCLcBGAs/s400/fileconcepts.jpg
https://2.bp.blogspot.com/-mp9qnSVQJh8/W9hcnyMwHII/AAAAAAAAA_8/3Gj2sdtDPJ4XaV6uWZ9SJNs5DIdpUHvqQCLcBGAs/s72-c/fileconcepts.jpg
Computer Science Junction
https://www.computersciencejunction.in/2018/06/file-management-in-operating-system.html
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/
https://www.computersciencejunction.in/2018/06/file-management-in-operating-system.html
true
425357657003182083
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share. STEP 2: Click the link you shared to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy