以编程方式强制 Spotlight 为特定不可见文件类型的元数据建立索引
有办法做到这一点吗?
原因是我试图在添加/删除不可见文件和文件夹时强制聚光灯接收自动更新。我认为这种行为是不索引元数据的副作用(但我可能是错的)。我从这个问题得出了这个结论。
解决方案是编写 mdimporter 吗?它甚至适用于不可见的文件类型吗?
Is there a way to accomplish this?
The reason for this is I am trying to force spotlight to receive automatic updates when invisible files and folders are added/removed. This behavior I believe is a side effect of not indexing the meta-data (but I could be wrong). I came to this conclusion from this SO question.
Is the solution writing a mdimporter? Will it even work for invisible file types?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过一些研究,似乎没有办法强制对不可见文件夹建立索引。
相反,我正在搜索所有文件夹并获取所有文件夹的更新。 (如果你想知道,仍然很快)
After some research, it seems there is no way to force indexing of invisible folders.
I am instead searching all folders and getting updates for all folders. (Still very fast if you are wondering)
我不是 Spotlight 专家,但无论如何我都会尝试一下。
我的理解是 Spotlight 只会索引它所知道的类型的文件。如果您想要索引的文件是自定义类型,那么您将需要编写一个 mdimporter。
我不知道 Spotlight 是否会索引不可见文件。
要强制聚光灯重新运行,请查看
mdimport
命令。I'm not a Spotlight expert, but I'll take a stab anyway.
My understanding is that Spotlight will only index files of types that it knows about. If the files that you want to have indexed are of a custom type, then you will need to write a mdimporter.
I don't know if Spotlight will index invisible files.
To force spotlight to rerun, check out the
mdimport
command.