Is there a way to tell Apple's content indexer to ignore a folder and its children by creating a file (similar to robots.txt) in the root of the folder to be ignored?

I don't want the folder to be listed in the privacy pane of system preferences since that's the first place someone who knows would go to look for "private" files.

Benefits of NOT using the system-preference panel:

  • More transportable - an ignore setting in an external drive that moves between computers would be easier to maintain
  • More private - listing a file to be ignored in a preference panel is hardly private

Is there a way to use a (slightly-more-stealthy .spotlight) settings file?

** edit **

Yes, I realize that this isn't a perfect solution, but it's good enough for my purposes.


Solution 1:

This answer to How can I make spotlight ignore certain file types and directories? appears have the solution:

$ cd DIRECTORY
$ touch .metadata_never_index

Solution 2:

Rename the containing folder to end with .noindex

Solution 3:

You can tell Spotlight to ignore a folder, but not by creating a file. In the System Preferences Spotlight pane select the Privacy tab and add the folder to the list of folders to not be indexed.