Search for question
Question

2. (10 pts) Create a universal module that receive TWO arguments i.e., "Action" which

determined how the module operates and "path" which tells what path file (can be folder or file)

we would like to modify. These actions are:

a) Add file, if "Action"=="ADD". (1 pts)

b) Remove file, if "Action"="REMOVE_FILE". (1 pts)

c)

Remove directory, if "Action"="REMOVE_DIR". (1 pts)

Rename file, if "Action"="RENAME". (1 pts)

d)

e) Open a file and write "STAT7008 ass 2", if "Action"="WRITE". (1 pts)

f) Add your own command with your own command "Action". (2 pts)

Moreover, when designing these functions, please use the right exception handling for each

function (3 pts i.e., failed to handle each section means deduction of 0.5 pts).

Fig: 1