Creating an Empty Resource ForkYou can use
CreateResFilewhen you want to create an empty resource fork--that is, a resource fork that contains no resource data but does include a resource map. Note that creating a resource fork does not automatically open it. To open a resource fork of a file created with one of these routines, use the corresponding routines
FSpCreateResFileprocedure is available only in System 7 and later versions of system software. If
FSpCreateResFileis not available, you can use
CreateResFileto create a resource fork. The
HCreateResFileprocedure allows you to specify a directory ID and a volume reference number, and is therefore preferred over
CreateResFileprocedure is an earlier version of
HCreateResFilethat is still supported but has more restricted capabilities.
Don't use the resource fork of a file for data that is not in resource format. The Resource Manager assumes that any information in a resource fork can be interpreted according to the standard resource format described in this chapter.
The File Manager assumes that the first block of a file's resource fork is part of the resource header and puts information there that it uses during scavenging--for example, after the user presses the Reset switch. For this reason, if you copy a resource file, the duplicate may not be exactly like the original.