Mac OS X: 文件图标制作和变更(Resource Fork)

编程入门 行业动态 更新时间:2024-10-10 15:19:57

Mac OS X: 文件<a href=https://www.elefans.com/category/jswz/34/1769937.html style=图标制作和变更(Resource Fork)"/>

Mac OS X: 文件图标制作和变更(Resource Fork)

Mac OS X: 文件图标变更(Resource Fork)

        在Mac系统里面,文件的一些属性是存储在Resource Fork里面的,这个在其它的系统里面基本上是没有的,是Mac系统的特点。

Resource Fork是存储文件结构化数据的存储方式,是和Data Fork相对比而言的, Data Fork就是我们最普通的一个文件的内容的存储方式了。

        那么Resource Fork里面到底存储什么呢?其实,如果你开发程序,基本上说,可以存储任何东西,但是造成的问题是,在当今的互联环境里不实用。

        而在Mac系统里面,它主要是保存,文件在GUI环境里面显示图标时的图标,窗口形状,程序码等等

 

        这里只说图标-icon. 在GUI环境里面,图标的设定比较容易,比如复制一个图形然后在一个文件的信息窗中粘贴图标旧恶可以了。

 

        下面的方法,也有使用GUI程序的部分,也有使用命令行的部分,命令行适合于管理员的管理和自动化。

 

# -----------------------------
# For files
# 1. Create a resource fork file (tempfork)
#     . From another file using derez command
#     . or use icongrapher to save as resource file
# 2. update file resource fold with the tempfork file
#     . using rez command
#     . or use icongrapher to save into a file
# 3. "setfile -a C" command
# -----------------------------
derez -only icns sourcefile > tempicns.rsrc
rez -a tempicns.rsrc -o recipienfile
setfile -a C recipienfile

# -----------------------------
# For Folders
#
# 1. (same as the 1. step in For Files)
# 2. copy the tempfork file in the folder
#     cp tempfork /folder/Icom^M
# 3. "setfile -a C" command
# -----------------------------
derez -only icns sourcefile > tempicns.rsrc
#cp tempfork TheFolder/Icon^M
setfile -a C TheFolder

# -----------------------------
# For Volumes
# create a .VolumeIcon.icns file in the root of the Volume
# This .icns file is actually a icon file which is save in
# Icon Composer or Preview.
# 3. "setfile -a C" command
# -----------------------------

CandyBar can be used for saving other format pictures to Mac icns

Ref:


原文链接:

转载于:

更多推荐

Mac OS X: 文件图标制作和变更(Resource Fork)

本文发布于:2024-03-04 03:54:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1708204.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图标   文件   OS   Mac   Resource

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!