Re: Discrepancy in fswatch.ml and fsmonitor.py

"Benjamin C. Pierce" <[email protected]> Mon, 25 Jan 2016 15:27:04 -0500
Newsgroups gmane.network.unison.devel
Message-ID <[email protected]>
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 <[email protected]> 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
> [email protected]
> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers

_______________________________________________
Unison-hackers mailing list
[email protected]
http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers