Change directory creation API call for MacOS.

This commit is contained in:
2021-03-14 04:55:42 +00:00
parent 88161c7a0d
commit 5c109c184b
10 changed files with 127 additions and 18 deletions

View File

@@ -101,7 +101,8 @@ void ResourceFork(const char* path)
FInfo finderInfo;
int32_t count;
HFileInfo* fpb;
CInfoPBRec cipbr;
CInfoPBRec cipbr;
HParamBlockRec dirPB;
snprintf((char*)str255, 255, "%s", path);
hpb.ioNamePtr = str255;
@@ -115,13 +116,23 @@ void ResourceFork(const char* path)
}
refNum = hpb.ioVRefNum;
rc = DirCreate(refNum, fsRtDirID, (unsigned char*)"\pRSRC", &dirId);
memset(&dirPB, 0, sizeof(HParamBlockRec));
dirPB.fileParam.ioCompletion = 0; // Nothing, sync
dirPB.fileParam.ioVRefNum = refNum; // Volume specification
dirPB.fileParam.ioNamePtr = (StringPtr) "\pRSRC"; // Directory name to create
dirPB.fileParam.ioDirID = 0; // ID of parent directory, 0 for root of volume
rc = PBDirCreate(&dirPB, 0);
if(rc)
{
printf("Error %d creating working directory.\n", rc);
return;
}
dirId = dirPB.fileParam.ioDirID;
printf("Creating resource forks.\n");
memset(&finderInfo, 0, sizeof(FInfo));