File monitor: Difference between revisions

From Hegemon Wiki
Jump to navigation Jump to search
(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 ....")
 
Line 2: Line 2:


==Use cases==
==Use cases==
- Watch for source code changes and rerun unit tests
* Watch for source code changes and rerun unit tests
- Shell command, should be cancelable
** Shell command, should be cancelable
- Needs to be filterable (ie .go, .cpp, .hpp)
** Needs to be filterable (ie .go, .cpp, .hpp)
- Watch for kernel/nvidia driver changes and copy to EFI
* Watch for kernel/nvidia driver changes and copy to EFI


==Requirements==
==Requirements==

Revision as of 00:08, 10 April 2016

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