[Unison-hackers] Discrepancy in fswatch.ml and fsmonitor.py

Benjamin C. Pierce bcpierce at cis.upenn.edu
Mon Jan 25 15:27:04 EST 2016


OK, after a little detective work, I think I understand… :-)

There are currently two file-watching modules in Unison:
fswatchold.ml, the older one (surprisingly enough), calls fsmonitor.py
fswatch.ml, the newer one, seems to work only on Linux and Windows; it calls unison-fsmonitor, which is an OCaml program (found in the fsmonitor subdirectory) that is built separately from Unison.  They use a somewhat fancier protocol to communicate.  
If you look around the rest of the code, you’ll see calls to both modules.  But calls to Fswatchold functions are forwarded to Fswatch if the newer monitor is running.

So you’re correct that fsmonitor.py is not the right place to start for you.  You probably want to clone fsmonitor/linux and go from there.

Best,

    - Benjamin



> On Dec 31, 2015, at 2:01 AM, Chris Stankevitz <chris at stankevitz.com> wrote:
> 
> Can someone explain this discrepancy in the 2.48.3 source distribution:
> 
> 1. fswatch.ml describes (and implements) a notification protocol in which stdin/stdout is used to communicate messages such as VERSION, OK, DIR, LINK, CHANGE, etc
> 
> 2. fsmonitor.py implements a notification protocol but it does not send or receive any of the commands in (1).  Furthermore it does not send commands to stdout, rather it writes them to a file called "changes" in a way that does not agree with (1).
> 
> What I was expecting to see:
> 
> 3. fswatch.ml describe a protocol
> 
> 4. fsmonitor.py implements the protocol in (3)
> 
> The reason I am asking: I would like to add freebsd support to the fsmonitor process.... but I am not confident that fsmonitor.py is the correct starting place.
> 
> Thank you,
> 
> Chris
> _______________________________________________
> Unison-hackers mailing list
> Unison-hackers at lists.seas.upenn.edu
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20160125/0fd9b5c4/attachment.html>


More information about the Unison-hackers mailing list