<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I also haven't found an intended command line way or program API to add a directory to exclude from Spotlight. (they are buried in a plist file in the Spotlight data directory for the particular mount point, and one could use command line tools to add it there, but I would NOT recommend risking it)<div class=""><br class=""></div><div class="">But in System Preferences ->Spotlight->Privacy tab, the usual command-shift-G type the path works just fine to set a directory (not needing to be a volume mount point) to exclude. That's probably needed because /opt/local/var/macports has the Finder invisible flag set.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 17, 2021, at 13:31, Peter Hancock <<a href="mailto:hancock@fastmail.fm" class="">hancock@fastmail.fm</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 17/11/2021 15:46, Chris Jones wrote:<br class=""><blockquote type="cite" class="">Some users might find it useful, and the exact volume to exclude<br class="">depends on the details of the users installation, which would be<br class="">difficult to automate. So I think its fine to just leave it to be<br class="">done by hand by those that wish to.<br class="">On 17/11/2021 3:09 pm, AndrĂ©-John Mas wrote:<br class=""><blockquote type="cite" class="">Just wondering whether it would make sense for MacPorts to auto<br class="">exclude that folder? Does spotlight even provide an API or command<br class="">that would allow MacPorts to do that?>><br class=""></blockquote></blockquote><br class="">AndrĂ©-John Mas mentions folders (directories?), while Chris Jones mentions volumes<br class="">(mounted filesystems?).<br class=""><br class="">On Catalina, for me the command "sudo mdutil -i off /opt/local/var/macports "<br class="">evokes:<br class="">[<br class="">Password:<br class="">/System/Volumes/Data/opt/local/var/macports:<br class="">Error: invalid operation.<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>Error: unknown indexing state.<br class="">]<br class=""><br class="">Trying to drag that directory into the appropriate System Preferences "privacy" pane,<br class="">accomplishes nothing. It doesn't appear on the list.<br class=""><br class="">My man page for mdutil seems to speak only about volumes. A bit of googling suggests<br class="">that though there *may* have been a time when you could exclude various directories<br class="">from spotlight indexing, by one trick or another, those days are gone.<br class=""><br class="">Am I wrong?<br class=""><br class="">I hope so. I'm getting pretty dyspeptic about how much of my computer seems to be<br class="">taken over by Spotlight and it's various underlings/minions.<br class=""><br class="">(Eg, It/they seem(s) to spend a large chunk of resources on creating tens/hundreds of thousands<br class="">of empty directories deep under /private/var/folders, to no apparent purpose.)<br class=""><br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>-- <br class="">eMail:<span class="Apple-tab-span" style="white-space: pre;">                          </span><a href="mailto:rlhamil@smart.net" class="">mailto:rlhamil@smart.net</a></div><div><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></div></body></html>