Important: The information in this document is obsolete and should not be used for new development.
PBHCreate
You can use thePBHCreate
function to create a new file.
FUNCTION PBHCreate (paramBlock: HParmBlkPtr; async: Boolean): OSErr;
paramBlock
- A pointer to a basic HFS parameter block.
async
- A Boolean value that specifies asynchronous (
TRUE) or synchronous (FALSE) execution.
--> ioCompletion
ProcPtr
A pointer to a completion routine. <-- ioResult
OSErr
The result code of the function. --> ioNamePtr
StringPtr
A pointer to a pathname. --> ioVRefNum
Integer
A volume specification. --> ioDirID
LongInt
A directory ID. DESCRIPTION
ThePBHCreate
function creates a new file (both forks); the new file is unlocked and empty. The date and time of its creation and last modification are set to the current date and time. If the file created isn't temporary (that is, if it will exist after the user quits the application), the application should callPBHSetFInfo
(afterPBHCreate
) to fill in the information needed by the Finder.Files created using
PBHCreate
are not automatically opened. If you want to write
data to the new file, you must first open the file using a file access routine (such
asPBHOpenDF
).
- Note
- The resource fork of the new file exists but is empty. You'll need to
call one of the Resource Manager proceduresCreateResFile
,HCreateResFile
, orFSpCreateResFile
to create a resource map in the file before you can open it (by calling one of the Resource Manager functionsOpenResFile
,HOpenResFile
, orFSpOpenResFile
).ASSEMBLY-LANGUAGE INFORMATION
The trap macro forPBHCreate
is_HCreate
.RESULT CODES