+1 vote
290 views
in Compilers & Operating Systems by

1 Answer

+1 vote
by
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 45 views
+1 vote
1 answer 54 views
+1 vote
1 answer 139 views
asked Sep 16, 2021 in Computer Networks by anonymous
+1 vote
1 answer 300 views
+1 vote
1 answer 766 views
+1 vote
1 answer 512 views
+1 vote
1 answer 2.3k views
+1 vote
1 answer 1.4k views
+1 vote
1 answer 2.9k views
+1 vote
1 answer 175 views
+1 vote
1 answer 223 views
asked Sep 17, 2021 in Computational Tools by anonymous
+1 vote
1 answer 310 views
+1 vote
1 answer 282 views
+1 vote
1 answer 291 views
+2 votes
1 answer 309 views
+1 vote
1 answer 653 views
+1 vote
1 answer 361 views
0 votes
1 answer 1.8k views
asked Oct 11, 2020 in Computer Networks by (user.guest)
+2 votes
1 answer 1.1k views
+2 votes
1 answer 433 views
+1 vote
1 answer 20 views
+1 vote
1 answer 24 views
+2 votes
1 answer 1.4k views
+1 vote
1 answer 200 views
+2 votes
1 answer 1.8k views
+1 vote
1 answer 44 views
+1 vote
1 answer 83 views
asked Sep 14, 2021 in Compilers & Operating Systems by anonymous
+1 vote
1 answer 1.6k views
+1 vote
1 answer 1.5k views
+1 vote
1 answer 2.3k views
+1 vote
1 answer 74 views
+1 vote
1 answer 466 views
Welcome to CPENTalk.com
Solution-oriented students of computer engineering on one platform to get you that

ONE SOLUTION

...