Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Support inotify API
int inotify_init(void);
int inotify_init1(int flags);
int inotify_add_watch(int fd, FAR const char *pathname, uint32_t mask);
int inotify_rm_watch(int fd, uint32_t wd);
The usage of the API is the same as that of the Linux version.
Usage
We can select CONFIG_FS_NOTIFY to enable this feature
Impact
The functionality is achieved based on monitoring various behaviors of the file system, which may have a slight impact on performance.
Testing
We can use libuv test cases for testing.
uv_run_tests fs_event_watch_dir
uv_run_tests fs_event_close_in_callback
uv_run_tests fs_event_watch_file
uv_run_tests fs_event_watch_file_current_dir
uv_run_tests fs_event_ref
uv_run_tests fs_event_immediate_close
uv_run_tests fs_event_watch_file_exact_path
uv_run_tests fs_event_no_callback_on_close
uv_run_tests fs_event_no_callback_after_close
uv_run_tests fs_event_close_with_pending_event
uv_run_tests fs_event_close_with_pending_delete_event
uv_run_tests fs_event_error_reporting
uv_run_tests fs_event_start_and_close
uv_run_tests fs_event_watch_file_twice
uv_run_tests fs_event_getpath
uv_run_tests fs_event_watch_invalid_path
uv_run_tests fs_event_stop_in_cb
All these test cases have passed.