Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Spotlight & .do files (Mac Users)


From   Phil Schumm <[email protected]>
To   [email protected]
Subject   Re: st: Spotlight & .do files (Mac Users)
Date   Tue, 29 Nov 2005 23:10:32 -0600

On Nov 23, 2005, at 10:33 AM, Ron�n Conroy wrote:
Spotlight does search the contents of do files, much to my relief. I recently had to locate all Stata do files that defined or used a particular variable to check for inconsistencies between different people working on the same project. Spotlight ran them all to earth in a trice.

A quick check on Stata's ado folder confirms it also searches ado files.

On Nov 29, 2005, at 1:07 PM, Eric G. Wruck wrote:
I just recently received the following update from Chinh Nguyen at Stata:

Just a little heads up. An Apple engineer relayed to me that the fact Spotlight isn't indexing Stata's do-files (the ones without the 'TEXT' file type) is a bug in Spotlight that probably won't be fixed until the next major release. However, he offered some untested (by him) suggestions that I will look into.

So, Ron�n you may want to check that Spotlight is working for you on recent .do files.

Just to be clear, the problem seems to occur (under OS X 10.4.3) only for those files with a ".do" extension. For example:


$ touch foo.do
$ SetFile -t TEXT foo.do
$ mdimport -d1 foo.do
2005-11-29 22:44:23.293 mdimport[617] Import '/Users/pschumm/Desktop/ foo.do' type 'dyn.ah62d4um4ge80k52' no mdimporter


However, if we change the extension to ".ado" (or even ".doo", say):


$ mv foo.do foo.ado
$ mdimport -d1 foo.ado
2005-11-29 22:44:33.047 mdimport[620] Import '/Users/pschumm/Desktop/ foo.ado' type 'com.apple.traditional-mac-plain-text' using 'file:// localhost/System/Library/Spotlight/RichText.mdimporter/'


then the file is indexed using the standard rich text importer. Interestingly, the same problem also seems to occur for files ending in ".tex", which is a bit of a pain for those using TeX, LaTeX, etc.

One alternative would be to write an importer which specifically claims files with a ".do" extension. However if this really is a bug in Spotlight, hopefully it'll be fixed at some point. Of course, if someone were so inclined, an importer to index .dta files (e.g., so that you could search on variable names and labels, dataset labels, etc.) would be nice...


-- Phil


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index