Question: Create a C function with the following capabilities:prog.c: Modify the template program, lookout.c on p . 5 6 - 5 7 with the following additional
Create a C function with the following capabilities:prog.c: Modify the template program, lookout.c on p with the following additional capabilitiesa. Repeat the following steps times this means, after seconds of running, your program should terminate without printing anything if there is no change detected.i Wait seconds using sleep callii. Call stat system call to extract the file attributes against given files in command line arguments the lookout.c program in p may accept up to files Your program should be able to accept up to files for monitoring.iii. You program should check any changes in any of the following attributes: stmode stnlink stsize statime stmtimeiv. When your program detects any changes, your program should immediately print out number codes given below and EXIT! Change of stmode print Change of stnlink print Change of stsize print Change of statime print Change of stmtime print Once printing is done, your program should terminate. Make sure your condition checking and printing should be done in the above order! Make sure you print number codes in one line without any newline character Example output when you change the file contents eg using vi: If your program prints more than one number code, then place spaces in between.Important: if your program doesnt print the corresponding number codes or if it prints more information than number codes, then your program will fail the tests, and you will get zero point for the tests. If there is no change detected during your program's execution, your program should exit without printing anything.Testing of your program can be done by opening two terminals, and run lookout in one terminal and, in another terminal, make some changes to the file contents, file permission modes, number of links, by using a variety of shell commands such as vi chmod, link, unlink, etc.In the terminal where lookout.c is running, the program should print the assigned code into display and exit. You need to submit prog.c into codePost.io in the same way as before.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
