[Solved]-Question 3 20 Marks Sketch Unix Facilities File System Calls Shown Onsisting Two Tables T Q37176810
Question 3 [20 Marks]. Below the sketch of the Unix facilities for file system calls is shown onsisting of: two tables; table entries; and primitive operations that work on these tables. Tables: – SysT: System wide file-table – PerT Per-process file-table – SysT: Perl RDfileName) # Read the directory information for a file from # the disk, and put them in a Table above # Write back the information of a file from Tables # to the disk # Search a Table for file name and return the Table # entry number for that file (ifile exists in Table) # Delete the Table entry by giving its entry number – WD fileName) SF(Table, fileName) DT(Table, entryNun) Tasks to do: A. [6 Marks] Fill the fields of the Tables with file attributes: file name; owner name; type: location in disk; size; access control; time/date; read/write pointer; file open count B. [6 Marks] Explain where is a file descriptor “fd” in the above operations and why the operating systems use file descriptors to handle file operations. C. [8 Marks] Use the above primitive operations, and also modify Table fields above for a file to perform the following file system calls. i. create-file(fileName) ii. open-file(fileName, Read-and-Write) iii. write-filelfd, Buffer, 100) iv. close-filelfd) v. delete-file fileName) # Note: create-file does not open the file Show transcribed image text Question 3 [20 Marks]. Below the sketch of the Unix facilities for file system calls is shown onsisting of: two tables; table entries; and primitive operations that work on these tables. Tables: – SysT: System wide file-table – PerT Per-process file-table – SysT: Perl RDfileName) # Read the directory information for a file from # the disk, and put them in a Table above # Write back the information of a file from Tables # to the disk # Search a Table for file name and return the Table # entry number for that file (ifile exists in Table) # Delete the Table entry by giving its entry number – WD fileName) SF(Table, fileName) DT(Table, entryNun) Tasks to do: A. [6 Marks] Fill the fields of the Tables with file attributes: file name; owner name; type: location in disk; size; access control; time/date; read/write pointer; file open count B. [6 Marks] Explain where is a file descriptor “fd” in the above operations and why the operating systems use file descriptors to handle file operations. C. [8 Marks] Use the above primitive operations, and also modify Table fields above for a file to perform the following file system calls. i. create-file(fileName) ii. open-file(fileName, Read-and-Write) iii. write-filelfd, Buffer, 100) iv. close-filelfd) v. delete-file fileName) # Note: create-file does not open the file
Expert Answer
Answer to Question 3 [20 Marks]. Below the sketch of the Unix facilities for file system calls is shown onsisting of: two tables; … . . .
OR

