https://github.com/findnextstep/filewatcher
watch file change or device change
https://github.com/findnextstep/filewatcher
Last synced: 9 months ago
JSON representation
watch file change or device change
- Host: GitHub
- URL: https://github.com/findnextstep/filewatcher
- Owner: findNextStep
- Created: 2019-07-01T15:15:22.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-19T15:50:00.000Z (over 6 years ago)
- Last Synced: 2025-03-11T02:30:58.876Z (over 1 year ago)
- Language: C++
- Size: 32.2 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# fileWatcher
- linux下的文件更改监视器
- 能够监视文本文件被是否被保存
- 功能基于linux下的inotify系统调用
- 不同编辑器的保存策略不同,可能会有不同的表现
1. vsocde采用直接保存,测试不会有问题
2. vim采用覆盖保存,测试不会有问题
3. gedit采用多次保存,测试一次保存会调用二次回调
4. nano会在启动时进行一次保存,其他没有问题
5. mv,cp命令可以正常检测
6. emacs支持
其他编辑器理论上也可以支持,建议使用测试程序先进行测试
# 使用说明
假设你使用一个git+cmake工程,添加filewatcher的步骤如下
1. 在你想放置filewatcher的文件夹下执行
`git submodule add https://github.com/findNextStep/fileWatcher`
2. 在你的`CMakeLists.txt`中添加include路径和相关链接库链接
```cmake
include_directories(${FILE_WATCHER_INCLUDE})
link_libraries(file_watcher)
```