Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 Node.js 应用程序中更改文件的元数据属性,问题是我需要在属性值中使用空格。我尝试了以下方法(使用 \ 添加空白),但没有奏效:
在下面的示例中,音乐流派应该是Hip Hop。
exec('xattr -w com.apple.metadata:kMDItemMusicalGenre "Hip\ Hop" PATH-TO-FILE')
我还尝试删除引号 (") 或使用模板文字来包装脚本,但它们都不起作用。请你帮我找出如何解决这个问题吗?提前谢谢你。