Skip to content

Commit

Permalink
Update files
Browse files Browse the repository at this point in the history
Signed-off-by: Obed N Munoz <[email protected]>
  • Loading branch information
obedmr committed Sep 29, 2020
1 parent 65b8c5f commit 9a2fbdf
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
1 change: 1 addition & 0 deletions labs/file-dir-monitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

include ../../common.mk
-include lab.mk
24 changes: 11 additions & 13 deletions labs/file-dir-monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The program should monitor events in all of the subdirectories under the specifi
To obtain a list of all of these subdirectories, you will need to make use of [nftw()](https://linux.die.net/man/3/nftw).
When a new subdirectory is added under the tree or a directory is deleted, the set of monitored subdirectories should be updated accordingly.


General Requirements and Considerations
---------------------------------------
- Use the logger that was done on [advanced-logger](https://github.com/CodersSquad/ap-labs/tree/master/labs/advanced-logger).
Expand All @@ -17,25 +18,22 @@ General Requirements and Considerations
- Don't forget to handle errors properly.
- Coding best practices implementation will be also considered.

Tests Cases
-----------
Below you can see how your program will be tested:

1. Run as privileged user
```
sudo ./monitor /tmp
```
Test Suite
----------
Build and Test automation is already implemented with the following command. Below some general tips and comments.

2. Monitor your home's directory
```
./monitor $HOME
```
- Make sure that your program passes all test cases without errors.
- Remember that this is being executed by a robot script.
- You cannot edit the `lab.mk` file.
- Failed compilation or segmentation faults means 0-graded.
- Failed tests without proper handling will be properly discounted from total grade.

3. Monitor the current path
```
./monitor $(pwd)
make test
```


How to submit your work and check your submission
=================================================
```
Expand Down
20 changes: 20 additions & 0 deletions labs/file-dir-monitor/lab.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# word-reverser build & test automation

APP_NAME=monitor
LIB_NAME=logger
build:
gcc -c ${APP_NAME}.c -o ${APP_NAME}.o
gcc -c ${LIB_NAME}.c -o ${LIB_NAME}.o
gcc ${LIB_NAME}.o ${APP_NAME}.o -o ${APP_NAME}
test: build
@echo Test 1
sudo ./${APP_NAME} /tmp
@echo Test 2
./${APP_NAME} ${HOME}
@echo Test 3
./${APP_NAME} $(PWD)
@echo Test 4 - failed
./${APP_NAME}

clean:
rm -rf *.o ${APP_NAME}

0 comments on commit 9a2fbdf

Please sign in to comment.