[OS X TeX] Spotlight importers

Maarten Sneep maarten.sneep at xs4all.nl
Tue May 3 04:33:17 EDT 2005


On May 3, 2005, at 9:57 AM, Bruno Voisin wrote:

> Seems very useful, and brings more general questions about  
> SpotLight which I couldn't find addressed in either OS X help or at  
> Apple's more technical page <http://developer.apple.com/macosx/ 
> spotlight.html>:

I can recommend the article over on Ars Technica [1], it contains a  
good description on SpotLight.

[1] http://arstechnica.com/reviews/os/macosx-10.4.ars

> - Is there an interface anywhere in Tiger to define when the  
> SpotLight database is built, and to know when it's being built? I  
> seem to remember seeing a dialog, immediately after installing  
> Tiger, telling the SpotLight database was built every 30 minutes,  
> but I can't find now where this is defined. Also, very often since  
> installing Tiger I hear the fans of my PowerBook spinning and  
> spinning and spinning, with no apparent reason, but can't see  
> anything happening in either Activity Monitor or with "top" in  
> Terminal. I imagine this is caused by SpotLight rebuilding its  
> database.

SpotLight doesn't rebuild the database. After installation of Tiger,  
each file write operation will cause that file to be re-indexed,  
which keeps the database in sync at all times. This is actually done  
at the Kernel level (so there are no ways around this. Experiment:  
create a smart folder which has all files in it that contain  
'blauwbilgorgel'. It is rather unlikely that you have a file with  
that in it (although this mail might appear in that smart folder  
right away). Keep the smart folder open. Now create a new, empty text  
file, copy'n'paste the word in that new file and save it somewhere.  
The file should immediately appear in the smart folder.

Of course some files may have ended up on disk slightly differently,  
and for those files a separate (low priority) process is run. This is  
probably a rare occurence, FireWire target disk mode with a pre-Tiger  
OS comes to mind, or a removable disk that is used with other  
systems. Unlikely for your main drive.

Of course there originally was a huge number of files on the drive  
that wasn't indexed. Depending on hte number of files, the indexing  
process may take several hours, but I guess you're past that now.

> - Aren't hidden directories like /usr/local/teTeX searched  
> automatically when building the SpotLight database?

I'm not sure if the hidden directories are indexed by default. Even  
though the indexing is hooked into the kernel to patch all file-write  
actions, it is still possible to exclude certain directories. there  
are a number of md* utilities:
     mdutil (remove an index, turn on or turn off indexing for a  
particular volume, status. requires sudo)
     mdimport (force a file or tree to be (re-)indexed.)
     mdls (see what info is indexed on a file)
     mdfind (use spotlight from the command-line, using the 'raw'  
syntax).

> - Given the files in this directory are generally owned by root  
> (depending on whether or not you stuck to the default setting when  
> installing the TeX i-Package), should mdimport be sudo'ed?

I'm not sure: you can still read those files. The security issues as  
to whether you should see a particular file in the results is handled  
at a different level.

> And getting OT, for those that might be interested:
>
> - I just noticed this morning on MacNN that Wolfram Research has  
> already released a SpotLight module for Mathematica notebooks  
> <http://library.wolfram.com/infocenter/Utilities/5614>. I just hope  
> it works with Mathematica 4!

I'd guess so, the functionality may be different, but the basic  
format is still text.

Maarten
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list