Mac OS X: resource fork)
In MAC systems, some attributes of files are stored in resource fork, which is basically absent in other systems and is characteristic of MAC systems.
Resource fork is a storage method for structured file data, which is relative to data fork. Data fork is the most common storage method for file content.
So what is stored in resource fork? In fact, if you develop a program, you can basically store everything, but the problem is that it is not practical in today's interconnected environments.
In MAC systems, it is mainly used for storage, and the icons, window shapes, program codes, and so on when files are displayed in the GUI environment.
Here, we only talk about the icon-icon. In the GUI environment, it is easier to set the icon. For example, you can copy a graph and paste it in the information window of a file.
The following methods also include the GUI program and the command line. The command line is suitable for administrator management and automation.
#-----------------------------
# 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:
Http://www.macgeekery.com/gspot/2006-09/copying_a_folders_icon_with_terminal_commands