Question: THIS ALL SHOULD COMPILE IN: C with these flags GCC 8.3 are -std=gnu99 and -Wpedantic This assignment asks you to generate reports (to STDOUT) about

THIS ALL SHOULD COMPILE IN: C with these flags "GCC 8.3 are -std=gnu99 and -Wpedantic"

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

THIS ALL SHOULD COMPILE IN: C with these flags "GCC 8.3 are

Example A Tree Directory Structure Report File System Report: Tree Directory Structure Level 1: /home/faculty/dastacey/C153110/Winter2021/Assignment Directories dastacey Faculty 38412 drwxr-x* Javascript Sun Mar 14 11:39:28 2021 Sun Mar 14 14:24:39 2021 dastacey (faculty 38333 drwxrwx 4 subDira Sun Mar 14 11:22:23 2021 Sun Mar 14 11:22:48 2021 Files dastacey (faculty) 38712 w 4642 Reporti Sun Mar 14 15.08:31 2021 Sun Mar 14 15.08:31 2021 dastacey faculty) 38714 wr 17416 IsReporti Sun Mar 14 15.08:33 2021 Sun Mar 14 15.08:33 2021 dastacey faculty) 38591 www 0 output Sun Mar 14 14:30:39 2021 Sun Mar 14 15.09:03 2021 Level 2: Javascript Files destacey faculty) 38565 r. 757704 mermaid.minis Sun Mar 14 14:20:40 2021 Sun Mar 14 14:24:09 2021 Level 2: subDira Files dastacey faculty) 38230 WXX 15872 Fancy Tue Mar 9 14:15:00 2021 Tue Mar 9 14:15:00 2021 dastacey (faculty) 38445. 2944 Fancy.c Sun Mar 14 12:56:57 2021 Sun Mar 14 12:56:57 2021 Level Formatting Level : Directory name (if this is Level I 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 tiles) files Example B: Inode Format Report File System Report: Inodes Level 1 Inodes: /home/faculty/dastacey/C153110/Winter 2021/Assignment 38333: 4 1 17 SubDirA 38412: 3 117 Javascript 38591: 1248 3 9 output 38859: 5175 9 IsReportlc 38851: 17416 35 17 IsReport1 Level 2 Inodes: SubDirA 38230: 16872 33 38446: 2944 17 isFancy IsFancy.c Level 2 Inodes: Javascript 38565757704 1480 341 mermaid.min.js Note: the separator between columns is a tabit) Example A Tree Directory Structure Report File System Report: Tree Directory Structure Level 1: /home/faculty/dastacey/C153110/Winter2021/Assignment Directories dastacey Faculty 38412 drwxr-x* Javascript Sun Mar 14 11:39:28 2021 Sun Mar 14 14:24:39 2021 dastacey (faculty 38333 drwxrwx 4 subDira Sun Mar 14 11:22:23 2021 Sun Mar 14 11:22:48 2021 Files dastacey (faculty) 38712 w 4642 Reporti Sun Mar 14 15.08:31 2021 Sun Mar 14 15.08:31 2021 dastacey faculty) 38714 wr 17416 IsReporti Sun Mar 14 15.08:33 2021 Sun Mar 14 15.08:33 2021 dastacey faculty) 38591 www 0 output Sun Mar 14 14:30:39 2021 Sun Mar 14 15.09:03 2021 Level 2: Javascript Files destacey faculty) 38565 r. 757704 mermaid.minis Sun Mar 14 14:20:40 2021 Sun Mar 14 14:24:09 2021 Level 2: subDira Files dastacey faculty) 38230 WXX 15872 Fancy Tue Mar 9 14:15:00 2021 Tue Mar 9 14:15:00 2021 dastacey (faculty) 38445. 2944 Fancy.c Sun Mar 14 12:56:57 2021 Sun Mar 14 12:56:57 2021 Level Formatting Level : Directory name (if this is Level I 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 tiles) files Example B: Inode Format Report File System Report: Inodes Level 1 Inodes: /home/faculty/dastacey/C153110/Winter 2021/Assignment 38333: 4 1 17 SubDirA 38412: 3 117 Javascript 38591: 1248 3 9 output 38859: 5175 9 IsReportlc 38851: 17416 35 17 IsReport1 Level 2 Inodes: SubDirA 38230: 16872 33 38446: 2944 17 isFancy IsFancy.c Level 2 Inodes: Javascript 38565757704 1480 341 mermaid.min.js Note: the separator between columns is a tabit)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!