Hi All,<br><br>First of all, I have to tell that I don'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'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's<br><br><div class="gmail_quote">2008/6/5 Sylvain Le Gall <<a href="mailto:sylvain@le-gall.net">sylvain@le-gall.net</a>>:<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 <<a href="mailto:bcpierce@cis.upenn.edu">bcpierce@cis.upenn.edu</a>> wrote:<br>
</div><div class="Ih2E3d">> Hi Sylvain,<br>
><br>
>>> I am a very humble user who just want to comment on this design (take<br>
>> all of this conditionaly -- if you feel this is just silly, forget<br>
>> about<br>
>> it).<br>
>><br>
>> I don't like the idea of the "file which should be a newline-separated<br>
>> list of paths (relative to the root of the synchronization)".<br>
>><br>
>> My idea is the following:<br>
>> - use "-repeat FOO" but FOO is a program<br>
>> - FOO read file scanned by unison on stdin<br>
>> - if FOO detects a change in a file scanned by UNISON, it writes it on<br>
>> stdout<br>
>><br>
>> In this design, unison has just to send absolute filename name to FOO<br>
>> and wait for FOO to write any notification.<br>
><br>
> I'm all in favor of simplicity, but I'm concerned about a couple of<br>
> points in this design.<br>
><br>
<br>
</div>I take the example of inotify, which i know a little bit.<br>
<div class="Ih2E3d"><br>
> 1) How is Unison going to hear about added files?<br>
><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 "/A/B" to FOO<br>
3) FOO ask inotify to watch directory "/A/B"<br>
4) user "touch /A/B/c"<br>
5) inotify notify FOO that a file "/A/B/c" has been created<br>
6) FOO send "/A/B/c" to unison (but doesn't ask for its watching)<br>
7) unison take into consideration the new file and apply rules to see if<br>
it fits every rules (ignore...)<br>
8) if unison is ok to take into account "/A/B/c" it sends "/A/B/c" to<br>
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>
> 2) Is Unison really going to tell FOO about *every* file it scans?<br>
> There may be very many of these (I haven't counted, but I'll bet there<br>
> 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>
- "-enc ENC": define filename encoding for data that will be<br>
send/receive<br>
- "-only-dir": 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'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>