Poor Man's Search Path
CreateResFile Create a new resource file or resource fork
#include <Resources.h> Resource Manager
void CreateResFile(fileName );
ConstStr255Param fileName ; address of length-prefixed filename
This function creates a new file with empty resource and data forks. If the
file already exists and has a non-empty resource fork, CreateResFile fails.
CreateResFile uses a heuristic known as the Poor Man's Search Path
which is described below.
fileName is the address of a Pascal-style length-prefixed file name. It may
contain volume and directory names. If volume and directory names
are omitted, the working directory is assumed.
Returns: none. Check ResError to be sure CreateResFile worked as
expected.

Notes: This function does not open the file. After creating the resource file, use
OpenResFile to obtain its file reference number and prepare for
subsequent access.
If filename already exists and has a non-empty resource fork, this does
NOT empty it. Instead, CreateResFile fails silently. Be sure to call
ResError to make sure that this call worked, or call Create or
PBCreate prior to calling CreateResFile.
Creating new resource files is not that common; development tools such as
ResEdit and RMaker exist for the purpose. If you do need to create one
yourself, a typical sequence is:
Create Create a resource file if it does not exist
CreateResFile Create an empty resource file
OpenResFile Get a refNum for access
AddResource Use various operations to...
RmveResource ...modify the file
ChangedResource Mark the file for update
WriteResource ...or...
CloseResFile ...to update the file on disk
See OpenRF for an example of usage.
Poor Man's Search Path
CreateResFile checks to see if a resource file with a given name exists;if
it does, it returns a dupFNErr (-48) error. Unfortunately,
CreateResFile uses a call that follows the Poor Man's Search Path
(PMSP). That is, it searches the current directory first, then searches the
blessed folder (the folder containing the currently booted system and
Finder) on the same volume. This means that CreateResFile will fail if a
file with the same name already exists in a directory that is in the PMSP.
To make sure that CreateResFile will create a resource file in the
current directory (whether or not a resource file with the same name
already exists further down the PMSP), call either PBCreate or Create
before calling CreateResFile. This works because Create and PBCreate
do not use the PMSP. By guaranteeing that the resource file exists in the
current directory, you can avoid having CreateResFile fail by finding
another resource file with the same name somewhere else in the PMSP.