Spotlight 未在 Cocoa 的所有目录中搜索 mp3 文件

发布于 2024-07-14 19:19:04 字数 173 浏览 6 评论 0原文

我必须在所有目录中搜索 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋顶上的小猫咪 2024-07-21 19:19:04

如果您不需要 Spotlight,您可以使用 unix 命令 查找。 命令行示例如下:

find ~ -name '*.mp3'

假设所有 mp3 文件都具有 .mp3 扩展名。

在 Cocoa 应用程序中,您必须将其包装在 NSTask 或使用 popen() 调用。

If Spotlight is not a requirement for you, you can use unix command find. An example command line is:

find ~ -name '*.mp3'

provided that all your mp3 files have .mp3 extention.

From a Cocoa app, you have to wrap it in a NSTask or use a popen() call.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文