spf13 / afero

A FileSystem Abstraction System for Go
Apache License 2.0
5.97k stars 513 forks source link

file change notify, like github.com/fsnotify/fsnotify? #131

Open corentone opened 7 years ago

corentone commented 7 years ago

Hello!

In our infrastructure, we regularly refresh a config file and need to detect file changes in order to properly reload. I've been a regular user of afero.Fs and was looking into the best way to do it...

Would you have suggestions? We currently use both the regular OS Fs and the in-Mem Fs.

For the OS Fs, I was looking into: https://github.com/fsnotify/fsnotify

Thanks!

purpleidea commented 7 years ago

Great idea :)

mbertschler commented 7 years ago

How would you like to use that feature? We could use the fsnotify for the standard OS filesystem but for all the other use cases we would need to implement it in the MemMapFs and so on.

purpleidea commented 7 years ago

@mbertschler Of course, although while OS would use fnotify, MemMapFs could also implement this by easily adding a hook onto any chmod or write call to any of the files. Similar patterns exist for the other backends.

akuzia commented 3 years ago

Any progress on this feature? Does fsnotify work for OsFs out of the box?