Lines Matching defs:osErr
315 OSErr osErr = ( source != NULL && destDir != NULL ) ? noErr : paramErr;
326 osErr = paramErr;
340 if( osErr == noErr )
341 osErr = CalculateBufferSize( source, destDir, ©Params.copyBufferSize);
343 if( osErr == noErr )
347 osErr = memFullErr;
350 if( osErr == noErr )
351 osErr = GetMagicBusyCreationDate( ©Params.magicBusyCreateDate );
353 if( osErr == noErr ) // figure out if source is a file or folder
361 osErr = FSGetCatalogInfo(source, kFSCatInfoNodeFlags, &tmpCatInfo, NULL, NULL, NULL);
362 if( osErr == noErr )
366 osErr = IsDropBox( destDir, ©Params.copyingToDropFolder );
368 if( osErr == noErr )
369 osErr = FSGetVRefNum(destDir, &destVRefNum);
370 if( osErr == noErr )
371 osErr = FSGetVolParms( destVRefNum, sizeof(volParms), &volParms, NULL );
372 if( osErr == noErr ) // volParms.vMServerAdr is non-zero for remote volumes
377 if( osErr == noErr )
381 osErr = CheckForDestInsideSource(source, destDir);
382 if( osErr == noErr )
383 osErr = FSCopyFolder( source, destDir, destNamePtr, ©Params, &filterParams, maxLevels, newObject );
386 osErr = FSCopyFile(source, destDir, destNamePtr, ©Params, &filterParams, newObject);
393 mycheck_noerr( osErr ); // put up debug assert in debug builds
395 return osErr;
411 OSErr osErr = ( source != NULL && destDir != NULL &&
415 if ( osErr == noErr )
419 osErr = FSGetCatalogInfo(source, filterParams->whichInfo, &sourceCatInfo, NULL, NULL, NULL);
423 osErr = FSGetCatalogInfo(source, filterParams->whichInfo, &sourceCatInfo, &filterParams->fileName, NULL, NULL);
425 if( osErr == noErr )
426 osErr = CopyFile(source, &sourceCatInfo, destDir, &filterParams->fileName, copyParams, &tmpRef);
432 (void) CallCopyObjectFilterProc(filterParams->filterProcPtr, false, 0, osErr, &sourceCatInfo,
437 if( osErr == noErr && newFile != NULL )
440 mycheck_noerr(osErr); // put up debug assert in debug builds
442 return osErr;
454 OSErr osErr = paramErr;
461 osErr = FSUsePBHCopyFile( source, destDir, 0, NULL, kTextEncodingUnknown, newFile );
464 if( osErr != noErr ) // then try old school file transfer
465 osErr = DoCopyFile( source, sourceCatInfo, destDir, destName, params, newFile );
467 mycheck_noerr(osErr); // put up debug assert in debug builds
469 return osErr;
486 OSErr osErr;
489 osErr = FSGetCatalogInfo(srcFileRef, kFSCatInfoNone, NULL, NULL, &srcFileSpec, NULL);
490 if( osErr == noErr ) // Make sure the volume supports CopyFile
491 osErr = FSGetVolParms( srcFileSpec.vRefNum, sizeof(GetVolParmsInfoBuffer), &volParmsInfo, NULL);
492 if( osErr == noErr )
493 osErr = VolHasCopyFile(&volParmsInfo) ? noErr : paramErr;
494 if( osErr == noErr ) // get the destination vRefNum and dirID
495 osErr = FSGetCatalogInfo(dstDirectoryRef, kFSCatInfoVolume | kFSCatInfoNodeID, &catalogInfo, NULL, NULL, NULL);
496 if( osErr == noErr ) // gather all the info needed
505 osErr = UnicodeNameGetHFSName(nameLength, copyName, textEncodingHint, false, hfsName);
506 pb.copyParam.ioCopyName = ( copyName != NULL && osErr == noErr ) ? hfsName : NULL;
508 if( osErr == noErr ) // tell the server to copy the object
509 osErr = PBHCopyFileSync(&pb);
511 if( osErr == noErr && newRef != NULL )
517 if( osErr != paramErr ) // returning paramErr is ok, it means PBHCopyFileSync was not supported
518 mycheck_noerr(osErr); // put up debug assert in debug builds
520 return osErr;
544 OSErr osErr;
575 osErr = FSCreateFileUnicode(destDir, destName->length, destName->unicode, kFSCatInfoSettableInfo, sourceCatInfo, &dest, NULL);
576 if( osErr == noErr ) // Copy the forks over to the new file
577 osErr = CopyItemsForks(source, &dest, params);
584 if (osErr == noErr && !params->copyingToDropFolder)
591 osErr = FSSetCatalogInfo(&dest, kFSCatInfoSettableInfo, sourceCatInfo);
607 if (osErr != noErr && osErr != dupFNErr )
612 mycheck_noerr(osErr); // put up debug assert in debug builds
614 return osErr;
725 OSErr osErr;
745 osErr = FSCopyFolderLevel(theGlobals, NULL);
750 osErr = CopyFile( &theGlobals->ref, &theGlobals->catalogInfo,
760 osErr, &theGlobals->catalogInfo,
827 OSErr osErr;
831 osErr = FSCompareFSRefs(source, &thisDir);
832 if (osErr == noErr)
833 osErr = errFSDestInsideSource;
834 else if (osErr == diffVolErr)
836 osErr = noErr;
839 else if (osErr == errFSRefsDifferent)
850 osErr = FSGetCatalogInfo(&thisDir, kFSCatInfoParentDirID, &thisDirInfo, NULL, NULL, &thisDir);
851 if( ( osErr == noErr ) && ( thisDirInfo.parentDirID == fsRtParID ) )
854 } while ( osErr == noErr && ! done );
856 mycheck_noerr( osErr ); // put up debug assert in debug builds
858 return osErr;
872 OSErr osErr;
881 osErr = FSGetDataForkName(&dataFork.forkName);
882 if( osErr == noErr )
883 osErr = FSGetResourceForkName(&rsrcFork.forkName);
884 if( osErr == noErr ) // First determine the list of forks that the source has.
885 osErr = CalculateForksToCopy(source, &dataFork, &rsrcFork, &otherForks, &otherForksCount);
886 if (osErr == noErr)
896 osErr = OpenAllForks(dest, &dataFork, &rsrcFork, otherForks, otherForksCount);
899 if (osErr == noErr && (dataFork.forkSize != 0)) // copy data fork
900 osErr = CopyFork(source, dest, &dataFork, params);
901 if (osErr == noErr && (rsrcFork.forkSize != 0)) // copy resource fork
902 osErr = CopyFork(source, dest, &rsrcFork, params);
903 if (osErr == noErr) { // copy other forks
904 for (thisForkIndex = 0; thisForkIndex < otherForksCount && osErr == noErr; thisForkIndex++)
905 osErr = CopyFork(source,dest, &otherForks[thisForkIndex], params);
915 if (osErr == noErr)
916 osErr = osErr2;
924 mycheck_noerr( osErr ); // put up debug assert in debug builds
926 return osErr;
944 OSErr osErr = noErr;
948 osErr = FSOpenFork(dest, dataFork->forkName.length, dataFork->forkName.unicode, fsWrPerm, &dataFork->forkDestRefNum);
949 if (osErr == noErr && rsrcFork->forkSize != 0) // Resource fork never needs to be created, so I don't have to FSCreateFork it here.
950 osErr = FSOpenFork(dest, rsrcFork->forkName.length, rsrcFork->forkName.unicode, fsWrPerm, &rsrcFork->forkDestRefNum);
952 if (osErr == noErr && otherForks != NULL && otherForksCount > 0) // Open the other forks.
954 for (thisForkIndex = 0; thisForkIndex < otherForksCount && osErr == noErr; thisForkIndex++)
965 osErr = FSCreateFork(dest, otherForks[thisForkIndex].forkName.length, otherForks[thisForkIndex].forkName.unicode);
966 if (osErr == noErr || osErr == afpAccessDenied)
967 osErr = noErr;
974 if (osErr == noErr)
975 osErr = FSOpenFork(dest, otherForks[thisForkIndex].forkName.length, otherForks[thisForkIndex].forkName.unicode, fsWrPerm, &otherForks[thisForkIndex].forkDestRefNum);
979 mycheck_noerr( osErr ); // put up debug assert in debug builds
981 return osErr;
997 OSErr osErr = noErr;
1006 osErr = FSCreateFork(dest, sourceFork->forkName.length, sourceFork->forkName.unicode);
1012 if (osErr == errFSForkExists && !params->copyingToLocalVolume)
1013 osErr = noErr;
1019 if (osErr == noErr && sourceFork->forkSize != 0) {
1029 osErr = FSOpenFork(dest, sourceFork->forkName.length, sourceFork->forkName.unicode, fsWrPerm, &destRef);
1034 if (osErr == noErr)
1035 osErr = FSOpenFork(source, sourceFork->forkName.length, sourceFork->forkName.unicode, fsRdPerm, &sourceRef);
1045 if( osErr == noErr )
1046 osErr = FSAllocateFork(destRef, kFSAllocNoRoundUpMask, fsFromStart, 0, sourceFork->forkSize, NULL);
1068 while (osErr == noErr && bytesRemaining != 0)
1083 osErr = FSReadFork(sourceRef, fsAtMark + noCacheMask, 0, bytesToReadThisTime, params->copyBuffer, NULL);
1084 if (osErr == noErr)
1085 osErr = FSWriteFork(destRef, fsAtMark + noCacheMask, 0, bytesToWriteThisTime, params->copyBuffer, NULL);
1086 if (osErr == noErr)
1090 if (osErr == noErr && (params->copyingToLocalVolume && ((sourceFork->forkSize & 0x01FF) != 0)) )
1091 osErr = FSSetForkSize(destRef, fsFromStart, sourceFork->forkSize);
1098 if (osErr == noErr)
1099 osErr = osErr2;
1108 if (osErr == noErr)
1109 osErr = osErr2;
1113 mycheck_noerr( osErr ); // put up debug assert in debug builds
1115 return osErr;
1124 OSErr osErr = noErr,
1131 if (osErr == noErr)
1132 osErr = osErr2;
1138 if (osErr == noErr)
1139 osErr = osErr2;
1149 if (osErr == noErr)
1150 osErr = osErr2;
1155 mycheck_noerr( osErr ); // put up debug assert in debug builds
1157 return osErr;
1183 OSErr osErr = ( (source != NULL) && (dataFork != NULL) &&
1196 while (osErr == noErr && ! done)
1198 osErr = FSIterateForks(source, &iterator, &thisForkName, &thisForkSize, NULL);
1199 if (osErr == errFSNoMoreItems)
1201 osErr = noErr;
1204 else if (osErr == noErr)
1222 osErr = memFullErr;
1237 osErr = memFullErr;
1244 if (osErr == noErr)
1257 if (osErr != noErr)
1270 mycheck_noerr( osErr ); // put up debug assert in debug builds
1272 return osErr;
1285 OSErr osErr = ( source != NULL && destDir != NULL && bufferSize != NULL ) ?
1288 if( osErr == noErr )
1289 osErr = FSGetVRefNum( source, &sourceVRefNum );
1290 if( osErr == noErr )
1291 osErr = FSGetVRefNum( destDir, &destVRefNum);
1292 if( osErr == noErr)
1305 mycheck_noerr( osErr ); // put up debug assert in debug builds
1307 return osErr;
1320 OSErr osErr;
1322 osErr = FSGetVolParms( vRefNum, sizeof(volParms), &volParms, &actualSize );
1323 if( osErr == noErr )
1343 mycheck_noerr( osErr ); // put up debug assert in debug builds
1391 OSErr osErr = ( source != NULL ) ? noErr : paramErr;
1394 if( osErr == noErr )
1395 osErr = FSGetCatalogInfo(source, kFSCatInfoNodeFlags, &catalogInfo, NULL, NULL,NULL);
1396 if( osErr == noErr && (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask) != 0 )
1398 osErr = FSDeleteFolder(source);
1400 if( osErr == noErr && (catalogInfo.nodeFlags & kFSNodeLockedMask) != 0 ) // is object locked?
1401 { // then attempt to unlock the object (ignore osErr since FSDeleteObject will set it correctly)
1405 if( osErr == noErr ) // delete the object (if it was a directory it is now empty, so we can delete it)
1406 osErr = FSDeleteObject(source);
1408 mycheck_noerr( osErr );
1410 return ( osErr );
1498 OSErr osErr;
1501 osErr = FSGetCatalogInfo(source, kFSCatInfoNodeFlags | kFSCatInfoPermissions, &tmpCatInfo, NULL, &sourceSpec, NULL);
1502 if( osErr == noErr ) // make sure the source is a directory
1503 osErr = ((tmpCatInfo.nodeFlags & kFSNodeIsDirectoryMask) != 0) ? noErr : errFSNotAFolder;
1504 if( osErr == noErr )
1516 osErr = PBHGetDirAccessSync(&hPB);
1517 if( osErr == noErr ) // its a drop folder if the current user only has write access
1519 else if ( osErr == paramErr )
1529 osErr = noErr;
1535 mycheck_noerr( osErr );
1537 return osErr;
1554 OSErr osErr = ( date != NULL ) ? noErr : paramErr;
1556 if( osErr == noErr )
1557 osErr = ConvertLocalTimeToUTC(kMagicBusyCreationDate, &tmpDate.lowSeconds);
1558 if( osErr == noErr )
1561 mycheck_noerr( osErr ); // put up debug assert in debug builds
1563 return osErr;
1579 OSErr osErr = ( ref != NULL && vRefNum != NULL ) ? noErr : paramErr;
1581 if( osErr == noErr ) /* get the volume refNum from the FSRef */
1582 osErr = FSGetCatalogInfo(ref, kFSCatInfoVolume, &catalogInfo, NULL, NULL, NULL);
1583 if( osErr == noErr )
1586 mycheck_noerr( osErr );
1588 return osErr;
1599 OSErr osErr = ( volParmsInfo != NULL ) ? noErr : paramErr;
1601 if( osErr == noErr )
1607 osErr = PBHGetVolParmsSync(&pb);
1610 if( osErr == noErr && actualInfoSize != NULL)
1613 mycheck_noerr( osErr ); // put up debug assert in debug builds
1615 return ( osErr );
1631 OSErr osErr = (hfsName != NULL && name != NULL ) ? noErr : paramErr;
1638 osErr = noErr; /* do nothing */
1649 osErr = UpgradeScriptInfoToTextEncoding(script, kTextLanguageDontCare,
1651 if ( osErr == paramErr )
1653 osErr = UpgradeScriptInfoToTextEncoding(script, kTextLanguageDontCare,
1657 if ( osErr != noErr ) // ok... try something
1667 osErr = CreateUnicodeToTextInfo(&uMapping, &utInfo);
1668 if( osErr == noErr )
1670 osErr = ConvertFromUnicodeToText( utInfo, unicodeByteLength, name, kUnicodeLooseMappingsMask,
1675 if( osErr == noErr )
1682 mycheck_noerr( osErr ); // put up debug assert in debug builds
1684 return ( osErr );
1695 OSErr osErr = ( ref != NULL ) ? noErr : paramErr;
1697 if( osErr == noErr )
1703 osErr = PBMakeFSRefSync(&pb);
1706 mycheck_noerr( osErr ); // put up debug assert in debug builds
1708 return ( osErr );