Comments (18)
Let's do it then :)
I've created a branch and starting implementing the linux backend:
https://github.com/cginternals/cppfs/tree/watcher
You could start implementing the Windows backend, if you like.
Please comment on the architecture and design.
from cppfs.
from cppfs.
This has finally been merged. Thank you very much for your contribution!
Please let me know if there are any more issues with this, or if I accidentally broke something with my latest changes :)
from cppfs.
Is there any work being done on this ? I'm in need of a simple filesystem watcher and could maybe contribute with at least linux + windows watchers.
from cppfs.
Actually, I've already implemented the Windows parts, and have started on linux backend, I'll push to my own fork it you want to check it out.
from cppfs.
Since inotify isn't recursive, I need to add watches on subfolders, and handle creation of subfolders aswell. Please do have a view at https://github.com/robiwano/cppfs for the general design pattern for file watchers.
from cppfs.
branch is feature/filewatch
from cppfs.
ok, I'll look into it and copy the recursive stuff for the linux backend. We should decide whether we want to have recursive as a flag or not. If you could prepare a pull request for the Windows backend following the interface in the watcher branch, that would be great. Let me know if you want changes to the structure/interfaces etc.
from cppfs.
I'll check the API in the watcher branch :)
from cppfs.
I like that the watcher stuff is separate from FileHandle. I'll modify my code accordingly.
from cppfs.
Please let me know if you are preparing a pull request for this branch to implement the Windows backend.
from cppfs.
I have a question regarding blocking watch(): My usecase will be a plugin whos lifetime is totally controlled from the outside. The watch() method will be called within a separate thread, thus, when the plugin is destroyed, the watch() method must unblock in order to terminate the thread in an orderly fashion. Thoughts ?
from cppfs.
Maybe add a timeout option to watch ? So it can return after X milliseconds ?
from cppfs.
Ok, I'm going with the timeout parameter to watch, turns out to be to cleanest approach. Will also update the cppfs-watch example to take a time parameter so it exits the application after the given time.
from cppfs.
I think having a timeout parameter would be a good solution. Please make it optional, so by default it should block without timeout. Maybe this helps for the posix implementation:
https://stackoverflow.com/questions/2917881/how-to-implement-a-timeout-in-read-function-call
from cppfs.
Yes, I found that same exact post :), seems to work fine for posix implementation, now I just need to get my VS IDE up and running (license expired π )...
from cppfs.
Btw, is it possible via cppassist cmd line tools to get multiple unnamed parameters into a vector of strings ? I'd like to be able to set multiple paths to monitor in cppfs-watch.
from cppfs.
Pull request issued.
from cppfs.
Related Issues (20)
- Special bits: Set UID/GID, Sticky Flags HOT 2
- Support for mingw on Windows HOT 3
- Can libcppfs.a (static library) be made part of Ubuntu PPA deb package HOT 1
- provide release libs to use them directly instead of Build by users HOT 4
- Handling unicode paths HOT 1
- Feature: File locking
- GoogleTest should be included as ExternalProject HOT 1
- Obtain CWD/PWD HOT 1
- Diff not handle folders been relplace by files with same name
- No file cppfs_api.h HOT 5
- Build Error [-Werror-deprecated-copy] HOT 2
- FileHandle.size() does not work well for large file(more than 3.9GB) HOT 2
- Use enum class instead of enum
- Watching files doesn't work on windows? HOT 2
- Remove std templates from interface HOT 2
- Why change default output paths?
- Why there's no support for file permissions on Windows?
- Incorrect path resolving for concatenated path separators. HOT 1
- removeDirectoryRec recursively follows symlink directories and should not ? HOT 4
- Error in testing (googletest) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppfs.