Skip to content

nicodalfonso/dirwatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to dirwatcher 👋

Version License: MIT Twitter: nicodalfonso

Preview of dirwatcher

A long running program that will monitor a specified directory for changes to any files of a type specified by the end user. Determines if any instances of a user-specified string (aka "magic text") appear in the files being watched, and logs their location.

Inspired by the story of The Cuckoo's Egg.

Prerequisites

  • You have Python 3.9.0 or greater installed locally.

Usage

python dirwatcher.py [dir] .[ext] [magic_text]

Example Usage

python dirwatcher.py ./test .txt hello

Example Output

2021-03-22 11:48:59,495 __main__	INFO
[MainThread  ]
-------------------------------------------------------------------
Beginning dirwatcher.py
searching for hello in /Users/nicodalfonso/dirwatcher/test
-------------------------------------------------------------------
2021-03-22 11:48:59,495 __main__	INFO
[MainThread  ] Adding test.txt to watchlist
2021-03-22 11:48:59,496 __main__	INFO
[MainThread  ] hello found on line 1 of test.txt
2021-03-22 11:48:59,496 __main__	INFO
[MainThread  ] hello found on line 2 of test.txt
2021-03-22 11:48:59,496 __main__	INFO
[MainThread  ] hello found on line 3 of test.txt
2021-03-22 11:48:59,496 __main__	INFO
[MainThread  ] hello found on line 5 of test.txt
^C2021-03-22 11:50:02,501 __main__	WARNING
[MainThread  ] Received SIGINT
2021-03-22 11:50:02,502 __main__	INFO
[MainThread  ] Exiting
2021-03-22 11:50:02,730 __main__	INFO
[MainThread  ]
-------------------------------------------------------------------
Stopped dirwatcher.py
Uptime was 00:01:3.2699471159999973
-------------------------------------------------------------------

Need Help?

python dirwatcher.py -h

OR

python dirwatcher.py --help

Author

👤 Nico D Alfonso

Acknowledgements

This project was initially created as a part of the Software Engineering Certification program from Kenzie Academy

To see the original instructions and acceptance criteria for this project, please reference README.old.md

📝 License

Copyright © 2021 Nico D Alfonso.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages