Closed iankronquist closed 8 years ago
Write a program in Go which uses the inotify syscalls to monitor changes to a given directory and print them to stdout in some structured format like json. I envision something like this:
$ ./fsmonitor some/dir/or/something { "path": "/file/which/changed", "type": "file", "modification": "contents-change" }, { "path": "/symlink/which/changed", "type": "symlink", "modification": "removed" }
Links which may be useful: https://golang.org/pkg/syscall/ https://gobyexample.com/json https://godoc.org/golang.org/x/exp/inotify http://man7.org/linux/man-pages/man7/inotify.7.html Section 19.2 of the The Linux Programming Interface may be useful.
Fixed by #4.
Write a program in Go which uses the inotify syscalls to monitor changes to a given directory and print them to stdout in some structured format like json. I envision something like this:
Links which may be useful: https://golang.org/pkg/syscall/ https://gobyexample.com/json https://godoc.org/golang.org/x/exp/inotify http://man7.org/linux/man-pages/man7/inotify.7.html Section 19.2 of the The Linux Programming Interface may be useful.