Question: Create a print _ permissions program that supports the following features. When a file is printed give the numeric value of the permissions, in the

Create a print_permissions program that supports the following features.
When a file is printed give the numeric value of the permissions, in the order of owner group other
Where execute is 1
Write is 2
Read is 4
for example a file named with:
user: rwx
group: r
other:w
Would print:
alpha (742)
if the command line argument -v is given:
print your student id and name, then the program exits.
if the command line argument -ux is given:
print all files in the next arguement's path that have the owner's execute permission bit set
if the command line argument -ur is given:
print all files in the next arguement's path that have the owner's read permission bit set
if the command line argument -uw is given:
print all files in the next arguement's path that have the owner's write permission bit set
if the command line argument -gx is given:
print all files in the next arguement's path that have the owner group's execute permission bit set
if the command line argument -gr is given:
print all files in the next arguement's path that have the owner group's read permission bit set
if the command line argument -gw is given:
print all files in the next arguement's path that have the owner group's write permission bit set
if the command line argument -ox is given:
print all files in the next arguement's path that have the other's execute permission bit set
if the command line argument -or is given:
print all files in the next arguement's path that have the other's read permission bit set
if the command line argument -ow is given:
print all files in the next arguement's path that have the other's write permission bit set
If you cannot traverse a directory print: directory skipped
for example:
./a.out -ow .
should print all files in the current directory (and sub directories) that have the other write permission set.
./a.out -ux ./test
should print all files in the test suddirectory (and sub its directories) that have the owner execute permission set.
./a.out -gr /
should print all files in the root directory (and sub directories) that have the group read permission set.

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!