File System Report To Stdout About The File System Supplied To The Program As A Command Line Argument.

Posted Under: Operating Systems

Ask A Question
DESCRIPTION
Posted
Modified
Viewed 21
Hi, I am looking for help on a project about a file system report based on the following document to be done in the C programming language. The program needs to generate reports (to STDOUT) about the file system supplied to the program as a command line argument. More information is provided in the file attached

This order does not have tags, yet.

Attachments
CIS3110 Operating Systems Winter 2021 Assignment 4: File System Reports This assignment asks you to generate reports (to STDOUT) about the file system that display information about the files and directories that appear in a directory that you have supplied to your program as a command line argument. Your program will be called FSreport and will take 2 arguments: - First argument is the type of report to be generated o -tree for tree directory structure format o -inode for inode format - Second argument is the full path name of the root directory (where the descriptions will start) Example: $ ./FSreport -tree /home/myname/rootDir You will use the fstat or stat command to retrieve information about the files and opendir and other related functions for information about directories. Your report can have 2 forms: Tree directory structure (-tree) - Sorted alphabetically by file/directory name - For each file/directory display the following: o Line 1: owner name (group name), inode number, permissions, size in bytes, file/directory name o Line 2: Date of last access, Date of last modification (to data or status whichever is most recent) - Each sub-directory in the file systems tree structure (starting with the given root directory) should be explored. - Indicate in your README if you can only report on the files/directories in the root directory (one level only) or if you can display multiple sub-directory levels (indicate the number of levels or the fact that your code can handle any number of levels). An example of this type of report is in Example A. Inodes Format (-inode) - Sorted by inode number – smallest to largest - For each file/directory display the following: o Inode number: size (in bytes), number of 512-byte blocks allocated to the file, file size/512, file/directory name An example of this type of report is in Example B. The following examples are reporting on the directory structure in the following diagram: Level 1 is Assignment4 (you would have specified its entire pathname as a command line argument. Level 2 are the contents of the sub-directories Javascript and subDirA. Example A: Tree Directory Structure Report File System Report: Tree Directory Structure Level 1: /home/faculty/dastacey/CIS3110/Winter2021/Assignment4 Directories dastacey (faculty) 38412 drwxr-xr-x 3 Javascript Sun Mar 14 11:39:28 2021 Sun Mar 14 14:24:39 2021 dastacey (faculty) 38333 drwxr-xr-x 4 subDirA Sun Mar 14 11:22:23 2021 Sun Mar 14 11:22:48 2021 Files dastacey (faculty) 38712 -rw-r--r-- 4642 lsReport1.c Sun Mar 14 15:08:31 2021 Sun Mar 14 15:08:31 2021 dastacey (faculty) 38714 -rwxr-xr-x 17416 lsReport1 Sun Mar 14 15:08:33 2021 Sun Mar 14 15:08:33 2021 dastacey (faculty) 38591 -rw-rw-rw- 0 output1 Sun Mar 14 14:30:39 2021 Sun Mar 14 15:09:03 2021 Level 2: Javascript Files dastacey (faculty) 38565 -rw-r--r-- 757704 mermaid.min.js Sun Mar 14 14:20:40 2021 Sun Mar 14 14:24:09 2021 Level 2: subDirA Files dastacey (faculty) 38230 -rwxr-xr-x 16872 lsFancy Tue Mar 9 14:15:00 2021 Tue Mar 9 14:15:00 2021 dastacey (faculty) 38446 -rw-r--r-- 2944 lsFancy.c Sun Mar 14 12:56:57 2021 Sun Mar 14 12:56:57 2021 Level Formatting: Level x: Directory name (if this is Level 1 then put the full path name otherwise just the directory name) Directories (this header does not appear if there are no sub-directories) ...directories Files (this header does not appear if there are no files) ...files Example B: Inode Format Report File System Report: Inodes Level 1 Inodes: /home/faculty/dastacey/CIS3110/Winter2021/Assignment4 38333: 4 1 17 subDirA 38412: 3 1 17 Javascript 38591: 1248 3 9 output1 38859: 5175 11 9 lsReport1.c 38861: 17416 35 17 lsReport1 Level 2 Inodes: subDirA 38230: 16872 33 17 lsFancy 38446: 2944 6 9 lsFancy.c Level 2 Inodes: Javascript 38565: 757704 1480 841 mermaid.min.js Note: the separator between columns is a tab (\t).
Explanations and Answers 0

No answers posted

Post your Answer - free or at a fee

Login to your tutor account to post an answer

Posting a free answer earns you +20 points.

Login

NB: Post a homework question for free and get answers - free or paid homework help.

Get answers to: File System Report To Stdout About The File System Supplied To The Program As A Command Line Argument. or similar questions only at Tutlance.

Related Questions