+1 vote
24 views

1 Answer

+1 vote
by (user.guest)
selected by (user.guest)
 
Best answer

File operations: 

The operating system can provide system calls to create, read, write, reposition, delete and truncate files.  

• Creating files: Two steps are necessary to create a file. First, space must be found for the file in the file system. Secondly, an entry must be made in the directory for the new file.  

• Reading a file: Data & read from the file at the current position. The system must keep a read pointer to know the location in the file from where the next read is to take place. Once  the read has been taken place, the read pointer is updated• Writing a file: Data are written to the file at the current position. The system must keep a write pointer to know the location in the file where the next write is to take place. The write pointer must be updated whenever a write occurs. 

• Repositioning within a file (seek): The directory is searched for the appropriate entry & the current file position is set to a given value. After repositioning data can be read from or written into that position. 

• Deleting a file: To delete a file, we search the directory for the required file. After deletion, the space is released so that it can be reused by other files. 

• Truncating a file: The user may erase the contents of a file but allows all attributes to remain unchanged expect the file length which is rest to ‘O’ & the space is released.        

Related questions

+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer
0 votes
0 answers
+1 vote
1 answer
+1 vote
1 answer
0 votes
1 answer
+2 votes
1 answer
+1 vote
1 answer
+1 vote
1 answer
Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...