Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twitter/libwatchman
A C interface to watchman
https://github.com/twitter/libwatchman
Last synced: 8 days ago
JSON representation
A C interface to watchman
- Host: GitHub
- URL: https://github.com/twitter/libwatchman
- Owner: twitter
- License: mit
- Created: 2014-04-11T15:29:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-06-07T00:45:31.000Z (over 5 years ago)
- Last Synced: 2024-07-31T22:56:08.373Z (3 months ago)
- Language: C
- Homepage:
- Size: 138 KB
- Stars: 45
- Watchers: 120
- Forks: 32
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libwatchman [![Build Status](https://secure.travis-ci.org/twitter/libwatchman.png)](http://travis-ci.org/twitter/libwatchman)
This is a C interface to watchman: https://www.github.com/facebook/watchman
You'll need jansson installed in order to use it, and check installed
to run the tests.Watchman is a wrapper around inotify, kevents, etc.
Using libwatchman is very straightforward: establish a connection with
watchman_connect, do some commands, then disconnect with
watchman_connection_close. These functions handle memory
management for you.To set up a watch on a directory, use watchman_watch.
To make a query, first construct an expression using the
watchman_*_expression functions, then use watchman_do_query. It's OK
to pass in a NULL value for the query parameter. You have to free
expressions yourself, using watchman_free_expression, but freeing an
expression will free all of its child expressions.A word of warning: stat fields are only valid for results returned
from watchman. You can choose these results by specifying flags for
the query. If you do not specify flags for the query, then you will
only get the default fields: name, exists, newer, size, modeMemory management:
Watchman makes copies of all strings it has been given. Using the
watchman_free_* functions will free these (as well as any other data
that watchman has allocated). Watchman never frees anything that it
hasn't created.## License
Copyright 2014-2015 Twitter, Inc and other contributorsLicensed under the MIT license