[OS X TeX] OT: Spotlight and command line [was Re: status of Spotlight indexing of .tex files?]
Michael Williams
williams at thphys.ox.ac.uk
Wed Dec 7 04:16:27 CET 2005
On 7 Dec 2005, at 02:33, Jan Anderssen wrote:
> Then I noticed that files disappeared from the Spotlight search
> (and didn't reappear in subsequent searches) when I renamed them
> from the commandline, via "mv". Is that something that happens? If
> you do something from the command line, you loose the indexed
> information? Are things that run scripts, like i-Installer affected
> as well? And what do I do to keep things up-to-date in the
> spotlight world?
The Mac-like way to shift files around the command line (i.e. the way
that preserved all HFS's resource fork bells and whistles) used to be
to use /Developer/Tools/CpMac, /Developer/Tools/MvMac and /usr/bin/ditto
However, since 10.4, the built-in cp and mv have done the right thing
and preserved type and creator codes:
[with cruft snipped]
otis:~/Library/TeXShop/Templates mike$ /Developer/Tools/GetFileInfo
Memoir.tex
type: "TEXT"
creator: "TeXs"
otis:~/Library/TeXShop/Templates mike$ cp Memoir.tex Memoir2.tex
otis:~/Library/TeXShop/Templates mike$ /Developer/Tools/GetFileInfo
Memoir2.tex
type: "TEXT"
creator: "TeXs"
otis:~/Library/TeXShop/Templates mike$ mv Memoir2.tex Memoir3.tex
otis:~/Library/TeXShop/Templates mike$ /Developer/Tools/GetFileInfo
Memoir3.tex
type: "TEXT"
creator: "TeXs"
Indeed, from the MvMac man page, "As of Mac OS X 10.4, the mv command
preserves metadata and resource forks of files on Extended HFS
volumes, so it can be used in place of MvMac. The MvMac command will
be deprecated in future versions of Mac OS X."
It's my (limited) understanding of Spotlight (it has such an
appalling UI that I don't make a habit of using it), that it should
now index the new file. Indeed, I did something similar to the above
thing with a regular .txt text file (created in TextEdit, as it
happens), and Spotlight found the copy fine.
However, trying this out with my LaTeX file, I can't see Memoir3.tex
from Spotlight. Unless the index lags the actual state of the
filesystem by several minutes (I thought it was the point of
spotlight that it doesn't), something very fishy is going on. I'm
afraid I have no idea what though!
P.S. more gory Spotlight details are here, for those that are
interested: <http://arstechnica.com/reviews/os/macosx-10.4.ars/9>
-- Mike
------------------------- 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 Archive: http://tug.org/pipermail/macostex-archives/
More information about the macostex-archives
mailing list