File monitor

From Hegemon Wiki
Revision as of 03:36, 9 April 2016 by H3g3m0n (talk | contribs) (Created page with "=Simplified File Watching Interface= ==Use cases== - Watch for source code changes and rerun unit tests - Shell command, should be cancelable - Needs to be filterable (ie ....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simplified File Watching Interface

Use cases

- Watch for source code changes and rerun unit tests

- Shell command, should be cancelable
- Needs to be filterable (ie .go, .cpp, .hpp)

- Watch for kernel/nvidia driver changes and copy to EFI

Requirements

- Must support cancelable shell command - Functions/GoRoutines can't be canceled - Different editors have differnt save strategies - Most changes result in multiple events (touch for example CREAT+CHMOD) - Should support a delay (could elivate spamming changes)

Modification time? Might not help if you copy an old file onto a new one...

fsnotify event examples

touch a

2016/04/09 11:59:47 Event: "/home/hegemon/programming/ansible/a": CREATE
2016/04/09 11:59:47 Event: "/home/hegemon/programming/ansible/a": CHMOD

vim :wq

2016/04/09 12:00:19 Event: "/home/hegemon/programming/ansible/4913": CREATE
2016/04/09 12:00:19 Event: "/home/hegemon/programming/ansible/a": RENAME
2016/04/09 12:00:19 Event: "/home/hegemon/programming/ansible/a": CREATE
2016/04/09 12:00:19 Event: "/home/hegemon/programming/ansible/a": WRITE
2016/04/09 12:00:19 Event: "/home/hegemon/programming/ansible/a": CHMOD

atom (save existing file):

2016/04/09 13:32:59 Event: "/home/hegemon/programming/ansible/a": WRITE
2016/04/09 13:32:59 Event: "/home/hegemon/programming/ansible/a": WRITE


mv b a

2016/04/09 13:31:24 Event: "/home/hegemon/programming/ansible/b": RENAME
2016/04/09 13:31:24 Event: "/home/hegemon/programming/ansible/a": CREATE