Mac OS X: resource fork)

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.