Implement filesystem watcher input#688
Implement filesystem watcher input#688henrikschristensen wants to merge 4 commits intowarpstreamlabs:mainfrom
Conversation
|
resolves #649 |
688b0aa to
9ec374e
Compare
9ec374e to
257d39c
Compare
257d39c to
b15c0e0
Compare
0bc4c0b to
0b22a5c
Compare
0b22a5c to
ce4d9d6
Compare
| } | ||
|
|
||
| func TestFSEventWatchNewSubdirsDeleteRecreate(t *testing.T) { | ||
| dir := t.TempDir() |
There was a problem hiding this comment.
Is there a chance we can use the testing/fstest instead of actually creating files/dirs on the OS?
There was a problem hiding this comment.
I dont think that is possible unless we write a mock for fsnotify too that can produce filesystem events when changes are made to the MapFS in testing/fstest.
I have not been able to find any examples of doing that.
I am aware of the dilemma that the tests rely on the actual OS that it is executed on, but abstracting that part out into some kind of mock would be a lot of work i fear.
I assume fsnotify itself is tested cross platform.
Added fsevent input. Can watch one or more folders for filesystem changes. Emits messages with metadata describing the event.
ce4d9d6 to
75ce1a6
Compare
|
It is a known problem that fsnotify produces a lot of redundant events when f.ex. a file is saved to a dir. Then it will typical produce a CREATE event followed by several WRITE events depending on file size and maybe a CHMOD event. This makes it hard to detect when a file done being written to the disk and as a result u risk reading parts of the file or empty content. I have tried to do something similar with existing bento components but I think it makes the resulting yaml very complicated and error prone. Any thoughts on this? |
|
Fixes #232 |
No description provided.