使用 hdiutil 创建混合 iso 时以编程方式隐藏许多文件
我正在尝试使用 hdiutil 编写混合 (iso/joliet/hfs) iso 的创建脚本。例如,我可以构建一个 iso 来隐藏 mac 端的内容,如下所示:
hdiutil makehybrid -o foo.iso -hfs -joliet -iso -hide-hfs "{foo/bar.txt,foo/other.rtf}" foo
这当然只是一个示例,但重点是我可以让它隐藏我指定的七个或八个示例文件,其中包含空格文件名以及各种点和下划线。
但对于我实际的真实交易脚本,我需要列出大约 70 个文件,当我测试它时,这似乎不起作用。整个字符串都正确传入,我知道这一点,因为当您打开“-verbose”时,它会打印该字符串并表示它与任何内容都不匹配。
所以我最好的猜测是它与传入的字符串的长度有关,但我在文档中没有看到任何表明这一点的内容。有什么想法吗?认为这是一个错误?实现此目的的替代方法是什么?
顺便说一句,这是在 Mac OS X 10.5.8 上。
I'm trying to script the creation of a hyrbid (iso/joliet/hfs) iso with hdiutil. I can, for example, build an iso that hides things on the mac side like so:
hdiutil makehybrid -o foo.iso -hfs -joliet -iso -hide-hfs "{foo/bar.txt,foo/other.rtf}" foo
That's just an example of course, but the point is I can get it to hide say seven or eight example files I specify like that, with spaces in the filenames and verious dots and underscores.
But for my actual real-deal script I need to list in the neighborhood of 70 files, which does not seem to work when I test it. The whole string is being passed in correctly, I know this because when you turn on '-verbose' it prints the string and says it doesn't match anything.
So my best guess is it has something to do with the length of the string passed in, but I don't see anything in the docs indicating that. Any ideas? Think it's a bug? An alternative way of accomplishing this?
This is on Mac OS X 10.5.8, btw.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两个[更新,使其成为三个](未经测试)建议:
使用
-plistin
选项指定所有参数;
(更好)尝试将文件组织为
隐藏到目录中,如果
必要的,这样你就可以轻松隐藏
它们由特定于目录的 glob 组成
而不必逐一拼出
文件。
[更新]您可以尝试使用cdrtools中的
mkisofs
来制作ISO图像。MacPorts
具有受支持的 端口它。 hdiutil 中的代码可能最初基于早期版本。无论如何,您都可以访问源代码,并可能找出限制。PS MacPorts 端口似乎存在一些小问题。特别是,
man
页安装在错误的目录中。 [更新:已在 3.00_1 中修复]Two [UPDATE, make it Three] (untested) suggestions:
use the
-plistin
option tospecify all the parameters;
(better) try organizing the files to be
hidden into directories, if
necessary, so you can easily hide
them by directory-specific globs
rather than having to spell out each
file.
[UPDATE] you could try using
mkisofs
from cdrtools to make the ISO image.MacPorts
has a supported port of it. It could be that the code inhdiutil
was originally based on an earlier version. In any case, you have the advantage of access to the source code and perhaps figuring out what the limitations are.P.S. There seems to be a couple of minor nits with the MacPorts port. In particular, the
man
pages are installed in the wrong directory. [UPDATE: fixed in 3.00_1]