15#if (defined(GENERATINGPOWERPC) || defined(GENERATING68K))
41CPCreateFile(
const char* fullFilePath,
int overwrite,
long macCreator,
long macFileType)
49 if (err = create(fullFilePath, 0, macCreator, macFileType))
57 long accessMode, shareMode;
60 accessMode = GENERIC_READ | GENERIC_WRITE;
62 fileH = CreateFile((LPCSTR) fullFilePath, accessMode, shareMode, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
63 if (fileH == INVALID_HANDLE_VALUE)
90 if (err = fsdelete(fullFilePath, 0))
100 if (DeleteFile((LPCSTR) fullFilePath) == 0)
101 err = GetLastError();
122 *fileRefPtr = fopen(fullFilePath, readOrWrite ?
"wb" :
"rb");
123 if (*fileRefPtr == NULL)
172 unsigned long numBytesRead;
175 if (numBytesReadPtr != NULL)
176 *numBytesReadPtr = 0;
181 numBytesRead = fread(buffer, 1, count, fileRef);
182 if (numBytesReadPtr != NULL)
183 *numBytesReadPtr = numBytesRead;
216 unsigned long numBytesRead;
219 if (numBytesReadPtr != NULL)
220 *numBytesReadPtr = 0;
225 numBytesRead = fread(buffer, 1, count, fileRef);
226 if (numBytesReadPtr != NULL)
227 *numBytesReadPtr = numBytesRead;
230 if (numBytesRead < count) {
254 unsigned long numBytesWritten;
257 if (numBytesWrittenPtr != NULL)
258 *numBytesWrittenPtr = 0;
262 numBytesWritten = fwrite(buffer, 1, count, fileRef);
263 if (numBytesWrittenPtr != NULL)
264 *numBytesWrittenPtr = numBytesWritten;
265 if (numBytesWritten != count)
285 pos = ftell(fileRef);
325 if (fseek(fileRef, filePos, seekMode) != 0)
361 originalPos = ftell(fileRef);
362 if (fseek(fileRef, 0, SEEK_END) != 0)
364 *numBytesPtr = ftell(fileRef);
365 if (*numBytesPtr == -1L)
367 if (fseek(fileRef, originalPos, SEEK_SET) != 0)