Hi All,<br><br>First of all, I have to tell that I don&#39;t understand the language used to develop unison (OCaml ?). So I will not be able to help is this way. But for an external tool, why not ...<br><br>Concerning Sylvain&#39;s design, I fully agree. Using a pipe to send external notifications to unison should be very efficient (under Linux and Windows, at least).<br>
<br>Thank&#39;s<br><br><div class="gmail_quote">2008/6/5 Sylvain Le Gall &lt;<a href="mailto:sylvain@le-gall.net">sylvain@le-gall.net</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 04-06-2008, Benjamin Pierce &lt;<a href="mailto:bcpierce@cis.upenn.edu">bcpierce@cis.upenn.edu</a>&gt; wrote:<br>
</div><div class="Ih2E3d">&gt; Hi Sylvain,<br>
&gt;<br>
&gt;&gt;&gt; I am a very humble user who just want to comment on this design (take<br>
&gt;&gt; all of this conditionaly -- if you feel this is just silly, forget<br>
&gt;&gt; about<br>
&gt;&gt; it).<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t like the idea of the &quot;file which should be a newline-separated<br>
&gt;&gt; list of paths (relative to the root of the synchronization)&quot;.<br>
&gt;&gt;<br>
&gt;&gt; My idea is the following:<br>
&gt;&gt; - use &quot;-repeat FOO&quot; but FOO is a program<br>
&gt;&gt; - FOO read file scanned by unison on stdin<br>
&gt;&gt; - if FOO detects a change in a file scanned by UNISON, it writes it on<br>
&gt;&gt; &nbsp;stdout<br>
&gt;&gt;<br>
&gt;&gt; In this design, unison has just to send absolute filename name to FOO<br>
&gt;&gt; and wait for FOO to write any notification.<br>
&gt;<br>
&gt; I&#39;m all in favor of simplicity, but I&#39;m concerned about a couple of<br>
&gt; points in this design.<br>
&gt;<br>
<br>
</div>I take the example of inotify, which i know a little bit.<br>
<div class="Ih2E3d"><br>
&gt; 1) How is Unison going to hear about added files?<br>
&gt;<br>
<br>
</div>If you ask to monitor a directory, you will get notified of file added<br>
in this directory (or directory added...).<br>
<br>
1) Let say unison scan directory /A/B.<br>
2) unison send &quot;/A/B&quot; to FOO<br>
3) FOO ask inotify to watch directory &quot;/A/B&quot;<br>
4) user &quot;touch /A/B/c&quot;<br>
5) inotify notify FOO that a file &quot;/A/B/c&quot; has been created<br>
6) FOO send &quot;/A/B/c&quot; to unison (but doesn&#39;t ask for its watching)<br>
7) unison take into consideration the new file and apply rules to see if<br>
 &nbsp; it fits every rules (ignore...)<br>
8) if unison is ok to take into account &quot;/A/B/c&quot; it sends &quot;/A/B/c&quot; to<br>
 &nbsp; FOO (stating that FOO should watch also this file).<br>
<br>
This way FOO has only little knowledge of what unison rules are. It just<br>
need to check for files that unison is asking him...<br>
<div class="Ih2E3d"><br>
&gt; 2) Is Unison really going to tell FOO about *every* file it scans?<br>
&gt; There may be very many of these (I haven&#39;t counted, but I&#39;ll bet there<br>
&gt; are more than 100k files in my filesystem).<br>
<br>
</div>Inotify can handle 100k files.<br>
Transfering 100k x average size of a filename through a pipe<br>
(stdin/stdout for a Unix.open_process) is the fastest communication<br>
channel on most system.<br>
<br>
But you have other options, unison can only tell foo to take into<br>
consideration directories (i.e. only send directory filename). inotify<br>
can also watch for changes of file in watched directory.<br>
<br>
Last but not least, FOO command line options should be simple and<br>
standard:<br>
- &quot;-enc ENC&quot;: define filename encoding for data that will be<br>
 &nbsp;send/receive<br>
- &quot;-only-dir&quot;: watch for changes only on directory<br>
<br>
The real advantage of my proposal is that FOO has very little to know<br>
about unison. FOO is only made to watch file...<br>
<br>
You also have the speed argument/power efficiency: unison is waked up<br>
only when there is a real change (i.e. FOO send a filename). There is no<br>
regular scan of the file. Scanning a file every now and then is a big<br>
problem (think of laptop user that don&#39;t like their hard drive to be<br>
spin up every 10 seconds).<br>
<br>
Regards,<br>
<font color="#888888">Sylvain Le Gall<br>
</font><br>
ps: i am not an expert at all, if you feel this proposal is not good,<br>
just tell me, i will stop arguing.<br>
<div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Unison-hackers mailing list<br>
<a href="mailto:Unison-hackers@lists.seas.upenn.edu">Unison-hackers@lists.seas.upenn.edu</a><br>
<a href="http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers" target="_blank">http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Patrice Espie<br>Art de France Export<br>总裁<br><br>Head office France :<br>3, rue G. Rossini, 26000 Valence<br>Tel: +33 4 75 02 27 70 - Mobile: +33 6 33 04 34 23<br>
<a href="http://www.art-de-france-export.com">www.art-de-france-export.com</a><br><br>Shanghai Office :<br>Victoire - 法艺阁<br>The Bund Side - Room 3102 - Building N°7<br>288 Baidu road - Shanghai 200010, China<br>Tel: +86 21 6332 0787 - Mobile: +86 139 1740 2646<br>
<a href="http://www.victoire.cn">www.victoire.cn</a>