Spotlight 未在 Cocoa 的所有目录中搜索 mp3 文件
我必须在所有目录中搜索 mp3 文件。 我使用 Spotlight 实现它,但它仅在 /user/userAccount/Music/Itunes Music 中搜索。 我已将歌曲存储在 Desktop/Songs/*.mp3 上,但它不会在此目录中搜索。
我应该做什么,我的应用程序将在所有目录中搜索。
I have to search mp3 files in all directories. I implement it using Spotlight, but it searches only in /user/userAccount/Music/Itunes Music. I have stored my songs on Desktop/Songs/*.mp3 and it doesn't search in this directory.
What should i do that my apps will search in all directories.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不需要 Spotlight,您可以使用 unix 命令
查找
。 命令行示例如下:假设所有 mp3 文件都具有
.mp3
扩展名。在 Cocoa 应用程序中,您必须将其包装在
NSTask
或使用popen()
调用。If Spotlight is not a requirement for you, you can use unix command
find
. An example command line is:provided that all your mp3 files have
.mp3
extention.From a Cocoa app, you have to wrap it in a
NSTask
or use apopen()
call.