Jacob Nordfalk <[email protected]> writes:

[...]

> I have this headache....:
>
> 1) The viewer is best suited for development pairs from SVN, but they
> are the hardest to find
>
> 2) I can find installed pairs (and online pairs) easily (looking in
> i.a. /usr/local/share, /usr/share), therefore I show them.
>
> I cannot find the development pairs as they could be anywhere on the
> file system.
>
> I feel that the effect of 1) + 2) is that people don't use
> Apertium-viewer for what its best for.
>
> Any ideas ?
>
> One idea would be to check if 'lt-comp' can be executed. 
> If yes, prompt the user to load some modes.
> Another (rather intrusive) way would be to scan the user's home
> directory and subdirectories for modes.

How about "locate/mdfind"?

$ time locate -eLb '\modes.xml' >/dev/null

real    0m0.247s
user    0m0.246s
sys     0m0.000s

I tend to think of the existence of a modes.xml as a fairly sure sign
that this is an apertium data directory.

Although, when I tried BSD locate it doesn't seem to allow using \ to
turn off non-globbing nor checking for file existence. But this command
seems portable while still running in <1s on a big old spindle drive:

$ locate -0 /modes.xml | grep -zZ '/modes\.xml$' | xargs -0 ls

(or you could do the grep and and existence check from Java).

On Mac, mdfind should be something like:

$ mdfind "kMDItemDisplayName == modes.xml"


In any case, the end result should probably be sorted by last access
time on the directory :-) 


-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff

Reply via email to