Building and Trying FileMQ
The FileMQ stack is on GitHub. It works like a classic C/C++ project:
git clone git://github.com/hintjens/filemq.git cd filemq ./autogen.sh ./configure make check
You want to be using the latest CZMQ master for this. Now try running the track command, which is a simple tool that uses FileMQ to track changes in one directory in another:
cd src ./track ./fmqroot/send ./fmqroot/recv
Open two file navigator windows, one into src/fmqroot/send and one into src/fmqroot/recv. Drop files into the send folder, and youâll see them arrive in the recv folder. The server checks once per second for new files. Delete files in the send folder, and theyâre deleted in the recv folder simultaneously.
I use track for things like updating my MP3 player, mounted as a USB drive. As I add or remove files in my laptopâs Music folder, the same changes happen on the MP3 player. FILEMQ isnât a full replication protocol yet, but weâll fix that later.
Get ZeroMQ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.