|
Mac OS 9
|
File Manager (MFS, HFS, and HFS+) Interfaces. More...
#include <MacTypes.h>#include <MixedMode.h>#include <OSUtils.h>#include <TextCommon.h>#include <UTCUtils.h>#include <Finder.h>Go to the source code of this file.
Data Structures | |
| struct | HFSUniStr255 |
| struct | GetVolParmsInfoBuffer |
| struct | IOParam |
| struct | FileParam |
| struct | VolumeParam |
| struct | CntrlParam |
| struct | SlotDevParam |
| struct | MultiDevParam |
| union | ParamBlockRec |
| struct | HFileInfo |
| struct | DirInfo |
| struct | CMovePBRec |
| struct | WDPBRec |
| struct | FCBPBRec |
| struct | VCB |
| struct | DrvQEl |
| struct | FSRef |
| struct | FSPermissionInfo |
| struct | FSCatalogInfo |
| struct | FSRefParam |
| struct | FSSearchParams |
| struct | FSCatalogBulkParam |
| struct | FSForkIOParam |
| struct | FSForkInfo |
| struct | FSForkCBInfoParam |
| struct | FSVolumeInfo |
| struct | FSVolumeInfoParam |
Macros | |
| #define | NewIOCompletionUPP(userRoutine) |
| #define | DisposeIOCompletionUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeIOCompletionUPP(paramBlock, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppIOCompletionProcInfo, (paramBlock)) |
| #define | NewIOCompletionProc(userRoutine) NewIOCompletionUPP(userRoutine) |
| #define | CallIOCompletionProc(userRoutine, paramBlock) InvokeIOCompletionUPP(paramBlock, userRoutine) |
| #define | PBGetVInfo(pb, async) ((async) ? PBGetVInfoAsync(pb) : PBGetVInfoSync(pb)) |
| #define | PBXGetVolInfo(pb, async) ((async) ? PBXGetVolInfoAsync(pb) : PBXGetVolInfoSync(pb)) |
| #define | PBGetVol(pb, async) ((async) ? PBGetVolAsync(pb) : PBGetVolSync(pb)) |
| #define | PBSetVol(pb, async) ((async) ? PBSetVolAsync(pb) : PBSetVolSync(pb)) |
| #define | PBFlushVol(pb, async) ((async) ? PBFlushVolAsync(pb) : PBFlushVolSync(pb)) |
| #define | PBCreate(pb, async) ((async) ? PBCreateAsync(pb) : PBCreateSync(pb)) |
| #define | PBDelete(pb, async) ((async) ? PBDeleteAsync(pb) : PBDeleteSync(pb)) |
| #define | PBOpenDF(pb, async) ((async) ? PBOpenDFAsync(pb) : PBOpenDFSync(pb)) |
| #define | PBOpenRF(pb, async) ((async) ? PBOpenRFAsync(pb) : PBOpenRFSync(pb)) |
| #define | PBRename(pb, async) ((async) ? PBRenameAsync(pb) : PBRenameSync(pb)) |
| #define | PBGetFInfo(pb, async) ((async) ? PBGetFInfoAsync(pb) : PBGetFInfoSync(pb)) |
| #define | PBSetFInfo(pb, async) ((async) ? PBSetFInfoAsync(pb) : PBSetFInfoSync(pb)) |
| #define | PBSetFLock(pb, async) ((async) ? PBSetFLockAsync(pb) : PBSetFLockSync(pb)) |
| #define | PBRstFLock(pb, async) ((async) ? PBRstFLockAsync(pb) : PBRstFLockSync(pb)) |
| #define | PBSetFVers(pb, async) ((async) ? PBSetFVersAsync(pb) : PBSetFVersSync(pb)) |
| #define | PBAllocate(pb, async) ((async) ? PBAllocateAsync(pb) : PBAllocateSync(pb)) |
| #define | PBGetEOF(pb, async) ((async) ? PBGetEOFAsync(pb) : PBGetEOFSync(pb)) |
| #define | PBSetEOF(pb, async) ((async) ? PBSetEOFAsync(pb) : PBSetEOFSync(pb)) |
| #define | PBGetFPos(pb, async) ((async) ? PBGetFPosAsync(pb) : PBGetFPosSync(pb)) |
| #define | PBSetFPos(pb, async) ((async) ? PBSetFPosAsync(pb) : PBSetFPosSync(pb)) |
| #define | PBFlushFile(pb, async) ((async) ? PBFlushFileAsync(pb) : PBFlushFileSync(pb)) |
| #define | PBCatSearch(pb, async) ((async) ? PBCatSearchAsync(pb) : PBCatSearchSync(pb)) |
| #define | PBOpenWD(pb, async) ((async) ? PBOpenWDAsync(pb) : PBOpenWDSync(pb)) |
| #define | PBCloseWD(pb, async) ((async) ? PBCloseWDAsync(pb) : PBCloseWDSync(pb)) |
| #define | PBHSetVol(pb, async) ((async) ? PBHSetVolAsync(pb) : PBHSetVolSync(pb)) |
| #define | PBHGetVol(pb, async) ((async) ? PBHGetVolAsync(pb) : PBHGetVolSync(pb)) |
| #define | PBCatMove(pb, async) ((async) ? PBCatMoveAsync(pb) : PBCatMoveSync(pb)) |
| #define | PBDirCreate(pb, async) ((async) ? PBDirCreateAsync(pb) : PBDirCreateSync(pb)) |
| #define | PBGetWDInfo(pb, async) ((async) ? PBGetWDInfoAsync(pb) : PBGetWDInfoSync(pb)) |
| #define | PBGetFCBInfo(pb, async) ((async) ? PBGetFCBInfoAsync(pb) : PBGetFCBInfoSync(pb)) |
| #define | PBGetCatInfo(pb, async) ((async) ? PBGetCatInfoAsync(pb) : PBGetCatInfoSync(pb)) |
| #define | PBSetCatInfo(pb, async) ((async) ? PBSetCatInfoAsync(pb) : PBSetCatInfoSync(pb)) |
| #define | PBAllocContig(pb, async) ((async) ? PBAllocContigAsync(pb) : PBAllocContigSync(pb)) |
| #define | PBLockRange(pb, async) ((async) ? PBLockRangeAsync(pb) : PBLockRangeSync(pb)) |
| #define | PBUnlockRange(pb, async) ((async) ? PBUnlockRangeAsync(pb) : PBUnlockRangeSync(pb)) |
| #define | PBSetVInfo(pb, async) ((async) ? PBSetVInfoAsync(pb) : PBSetVInfoSync(pb)) |
| #define | PBHGetVInfo(pb, async) ((async) ? PBHGetVInfoAsync(pb) : PBHGetVInfoSync(pb)) |
| #define | PBHOpen(pb, async) ((async) ? PBHOpenAsync(pb) : PBHOpenSync(pb)) |
| #define | PBHOpenRF(pb, async) ((async) ? PBHOpenRFAsync(pb) : PBHOpenRFSync(pb)) |
| #define | PBHOpenDF(pb, async) ((async) ? PBHOpenDFAsync(pb) : PBHOpenDFSync(pb)) |
| #define | PBHCreate(pb, async) ((async) ? PBHCreateAsync(pb) : PBHCreateSync(pb)) |
| #define | PBHDelete(pb, async) ((async) ? PBHDeleteAsync(pb) : PBHDeleteSync(pb)) |
| #define | PBHRename(pb, async) ((async) ? PBHRenameAsync(pb) : PBHRenameSync(pb)) |
| #define | PBHRstFLock(pb, async) ((async) ? PBHRstFLockAsync(pb) : PBHRstFLockSync(pb)) |
| #define | PBHSetFLock(pb, async) ((async) ? PBHSetFLockAsync(pb) : PBHSetFLockSync(pb)) |
| #define | PBHGetFInfo(pb, async) ((async) ? PBHGetFInfoAsync(pb) : PBHGetFInfoSync(pb)) |
| #define | PBHSetFInfo(pb, async) ((async) ? PBHSetFInfoAsync(pb) : PBHSetFInfoSync(pb)) |
| #define | PBMakeFSSpec(pb, async) ((async) ? PBMakeFSSpecAsync(pb) : PBMakeFSSpecSync(pb)) |
| #define | PBHGetVolParms(pb, async) ((async) ? PBHGetVolParmsAsync(pb) : PBHGetVolParmsSync(pb)) |
| #define | PBHGetLogInInfo(pb, async) ((async) ? PBHGetLogInInfoAsync(pb) : PBHGetLogInInfoSync(pb)) |
| #define | PBHGetDirAccess(pb, async) ((async) ? PBHGetDirAccessAsync(pb) : PBHGetDirAccessSync(pb)) |
| #define | PBHSetDirAccess(pb, async) ((async) ? PBHSetDirAccessAsync(pb) : PBHSetDirAccessSync(pb)) |
| #define | PBHMapID(pb, async) ((async) ? PBHMapIDAsync(pb) : PBHMapIDSync(pb)) |
| #define | PBHMapName(pb, async) ((async) ? PBHMapNameAsync(pb) : PBHMapNameSync(pb)) |
| #define | PBHCopyFile(pb, async) ((async) ? PBHCopyFileAsync(pb) : PBHCopyFileSync(pb)) |
| #define | PBHMoveRename(pb, async) ((async) ? PBHMoveRenameAsync(pb) : PBHMoveRenameSync(pb)) |
| #define | PBHOpenDeny(pb, async) ((async) ? PBHOpenDenyAsync(pb) : PBHOpenDenySync(pb)) |
| #define | PBHOpenRFDeny(pb, async) ((async) ? PBHOpenRFDenyAsync(pb) : PBHOpenRFDenySync(pb)) |
| #define | PBExchangeFiles(pb, async) ((async) ? PBExchangeFilesAsync(pb) : PBExchangeFilesSync(pb)) |
| #define | PBCreateFileIDRef(pb, async) ((async) ? PBCreateFileIDRefAsync(pb) : PBCreateFileIDRefSync(pb)) |
| #define | PBResolveFileIDRef(pb, async) ((async) ? PBResolveFileIDRefAsync(pb) : PBResolveFileIDRefSync(pb)) |
| #define | PBDeleteFileIDRef(pb, async) ((async) ? PBDeleteFileIDRefAsync(pb) : PBDeleteFileIDRefSync(pb)) |
| #define | PBGetForeignPrivs(pb, async) ((async) ? PBGetForeignPrivsAsync(pb) : PBGetForeignPrivsSync(pb)) |
| #define | PBSetForeignPrivs(pb, async) ((async) ? PBSetForeignPrivsAsync(pb) : PBSetForeignPrivsSync(pb)) |
| #define | PBDTAddIcon(pb, async) ((async) ? PBDTAddIconAsync(pb) : PBDTAddIconSync(pb)) |
| #define | PBDTGetIcon(pb, async) ((async) ? PBDTGetIconAsync(pb) : PBDTGetIconSync(pb)) |
| #define | PBDTGetIconInfo(pb, async) ((async) ? PBDTGetIconInfoAsync(pb) : PBDTGetIconInfoSync(pb)) |
| #define | PBDTAddAPPL(pb, async) ((async) ? PBDTAddAPPLAsync(pb) : PBDTAddAPPLSync(pb)) |
| #define | PBDTRemoveAPPL(pb, async) ((async) ? PBDTRemoveAPPLAsync(pb) : PBDTRemoveAPPLSync(pb)) |
| #define | PBDTGetAPPL(pb, async) ((async) ? PBDTGetAPPLAsync(pb) : PBDTGetAPPLSync(pb)) |
| #define | PBDTSetComment(pb, async) ((async) ? PBDTSetCommentAsync(pb) : PBDTSetCommentSync(pb)) |
| #define | PBDTRemoveComment(pb, async) ((async) ? PBDTRemoveCommentAsync(pb) : PBDTRemoveCommentSync(pb)) |
| #define | PBDTGetComment(pb, async) ((async) ? PBDTGetCommentAsync(pb) : PBDTGetCommentSync(pb)) |
| #define | PBDTFlush(pb, async) ((async) ? PBDTFlushAsync(pb) : PBDTFlushSync(pb)) |
| #define | PBDTReset(pb, async) ((async) ? PBDTResetAsync(pb) : PBDTResetSync(pb)) |
| #define | PBDTGetInfo(pb, async) ((async) ? PBDTGetInfoAsync(pb) : PBDTGetInfoSync(pb)) |
| #define | PBDTDelete(pb, async) ((async) ? PBDTDeleteAsync(pb) : PBDTDeleteSync(pb)) |
| #define | NewFNSubscriptionUPP(userRoutine) (userRoutine) |
| #define | DisposeFNSubscriptionUPP(userUPP) |
| #define | InvokeFNSubscriptionUPP(message, flags, refcon, subscription, userUPP) (*userUPP)(message, flags, refcon, subscription) |
| #define | NewFNSubscriptionUPP(userRoutine) (userRoutine) |
| #define | DisposeFNSubscriptionUPP(userUPP) |
| #define | InvokeFNSubscriptionUPP(message, flags, refcon, subscription, userUPP) (*userUPP)(message, flags, refcon, subscription) |
Typedefs | |
| typedef struct HFSUniStr255 | HFSUniStr255 |
| typedef const HFSUniStr255 * | ConstHFSUniStr255Param |
| typedef struct GetVolParmsInfoBuffer | GetVolParmsInfoBuffer |
| typedef union ParamBlockRec | ParamBlockRec |
| typedef ParamBlockRec * | ParmBlkPtr |
| typedef struct IOParam | IOParam |
| typedef IOParam * | IOParamPtr |
| typedef struct FileParam | FileParam |
| typedef FileParam * | FileParamPtr |
| typedef struct VolumeParam | VolumeParam |
| typedef VolumeParam * | VolumeParamPtr |
| typedef struct CntrlParam | CntrlParam |
| typedef CntrlParam * | CntrlParamPtr |
| typedef struct SlotDevParam | SlotDevParam |
| typedef SlotDevParam * | SlotDevParamPtr |
| typedef struct MultiDevParam | MultiDevParam |
| typedef MultiDevParam * | MultiDevParamPtr |
| typedef struct HFileInfo | HFileInfo |
| typedef struct DirInfo | DirInfo |
| typedef union HParamBlockRec | HParamBlockRec |
| typedef HParamBlockRec * | HParmBlkPtr |
| typedef struct CMovePBRec | CMovePBRec |
| typedef CMovePBRec * | CMovePBPtr |
| typedef struct WDPBRec | WDPBRec |
| typedef WDPBRec * | WDPBPtr |
| typedef struct FCBPBRec | FCBPBRec |
| typedef FCBPBRec * | FCBPBPtr |
| typedef struct VCB | VCB |
| typedef VCB * | VCBPtr |
| typedef struct DrvQEl | DrvQEl |
| typedef DrvQEl * | DrvQElPtr |
| typedef SInt16 | FSVolumeRefNum |
| typedef struct FSRef | FSRef |
| typedef FSRef * | FSRefPtr |
| typedef struct FSPermissionInfo | FSPermissionInfo |
| typedef UInt32 | FSCatalogInfoBitmap |
| typedef struct FSCatalogInfo | FSCatalogInfo |
| typedef FSCatalogInfo * | FSCatalogInfoPtr |
| typedef struct FSRefParam | FSRefParam |
| typedef FSRefParam * | FSRefParamPtr |
| typedef struct OpaqueFSIterator * | FSIterator |
| typedef OptionBits | FSIteratorFlags |
| typedef struct FSSearchParams | FSSearchParams |
| typedef FSSearchParams * | FSSearchParamsPtr |
| typedef struct FSCatalogBulkParam | FSCatalogBulkParam |
| typedef FSCatalogBulkParam * | FSCatalogBulkParamPtr |
| typedef UInt16 | FSAllocationFlags |
| typedef struct FSForkIOParam | FSForkIOParam |
| typedef FSForkIOParam * | FSForkIOParamPtr |
| typedef struct FSForkInfo | FSForkInfo |
| typedef FSForkInfo * | FSForkInfoPtr |
| typedef struct FSForkCBInfoParam | FSForkCBInfoParam |
| typedef FSForkCBInfoParam * | FSForkCBInfoParamPtr |
| typedef UInt32 | FSVolumeInfoBitmap |
| typedef struct FSVolumeInfo | FSVolumeInfo |
| typedef FSVolumeInfo * | FSVolumeInfoPtr |
| typedef struct FSVolumeInfoParam | FSVolumeInfoParam |
| typedef FSVolumeInfoParam * | FSVolumeInfoParamPtr |
| typedef UInt32 | FNMessage |
| typedef struct OpaqueFNSubscriptionRef * | FNSubscriptionRef |
| typedef OptionBits | flags |
| typedef OptionBits void * | refcon |
| typedef OptionBits void FNSubscriptionRef | subscription |
Enumerations | |
| enum | { fsCurPerm = 0x00 , fsRdPerm = 0x01 , fsWrPerm = 0x02 , fsRdWrPerm = 0x03 , fsRdWrShPerm = 0x04 , fsRdDenyPerm = 0x10 , fsWrDenyPerm = 0x20 } |
| enum | { fsRtParID = 1 , fsRtDirID = 2 } |
| enum | { fsAtMark = 0 , fsFromStart = 1 , fsFromLEOF = 2 , fsFromMark = 3 } |
| enum | { pleaseCacheBit = 4 , pleaseCacheMask = 0x0010 , noCacheBit = 5 , noCacheMask = 0x0020 , rdVerifyBit = 6 , rdVerifyMask = 0x0040 , rdVerify = 64 , forceReadBit = 6 , forceReadMask = 0x0040 , newLineBit = 7 , newLineMask = 0x0080 , newLineCharMask = 0xFF00 } |
| enum | { fsSBPartialName = 1 , fsSBFullName = 2 , fsSBFlAttrib = 4 , fsSBFlFndrInfo = 8 , fsSBFlLgLen = 32 , fsSBFlPyLen = 64 , fsSBFlRLgLen = 128 , fsSBFlRPyLen = 256 , fsSBFlCrDat = 512 , fsSBFlMdDat = 1024 , fsSBFlBkDat = 2048 , fsSBFlXFndrInfo = 4096 , fsSBFlParID = 8192 , fsSBNegate = 16384 , fsSBDrUsrWds = 8 , fsSBDrNmFls = 16 , fsSBDrCrDat = 512 , fsSBDrMdDat = 1024 , fsSBDrBkDat = 2048 , fsSBDrFndrInfo = 4096 , fsSBDrParID = 8192 } |
| enum | { fsSBPartialNameBit = 0 , fsSBFullNameBit = 1 , fsSBFlAttribBit = 2 , fsSBFlFndrInfoBit = 3 , fsSBFlLgLenBit = 5 , fsSBFlPyLenBit = 6 , fsSBFlRLgLenBit = 7 , fsSBFlRPyLenBit = 8 , fsSBFlCrDatBit = 9 , fsSBFlMdDatBit = 10 , fsSBFlBkDatBit = 11 , fsSBFlXFndrInfoBit = 12 , fsSBFlParIDBit = 13 , fsSBNegateBit = 14 , fsSBDrUsrWdsBit = 3 , fsSBDrNmFlsBit = 4 , fsSBDrCrDatBit = 9 , fsSBDrMdDatBit = 10 , fsSBDrBkDatBit = 11 , fsSBDrFndrInfoBit = 12 , fsSBDrParIDBit = 13 } |
| enum | { bLimitFCBs = 31 , bLocalWList = 30 , bNoMiniFndr = 29 , bNoVNEdit = 28 , bNoLclSync = 27 , bTrshOffLine = 26 , bNoSwitchTo = 25 , bDontShareIt = 21 , bNoDeskItems = 20 , bNoBootBlks = 19 , bAccessCntl = 18 , bNoSysDir = 17 , bHasExtFSVol = 16 , bHasOpenDeny = 15 , bHasCopyFile = 14 , bHasMoveRename = 13 , bHasDesktopMgr = 12 , bHasShortName = 11 , bHasFolderLock = 10 , bHasPersonalAccessPrivileges = 9 , bHasUserGroupList = 8 , bHasCatSearch = 7 , bHasFileIDs = 6 , bHasBTreeMgr = 5 , bHasBlankAccessPrivileges = 4 , bSupportsAsyncRequests = 3 , bSupportsTrashVolumeCache = 2 } |
| enum | { bIsEjectable = 0 , bSupportsHFSPlusAPIs = 1 , bSupportsFSCatalogSearch = 2 , bSupportsFSExchangeObjects = 3 , bSupports2TBFiles = 4 , bSupportsLongNames = 5 , bSupportsMultiScriptNames , bSupportsNamedForks , bSupportsSubtreeIterators , bL2PCanMapFileBlocks = 9 } |
| enum | { bParentModDateChanges , bAncestorModDateChanges } |
| enum | { bSupportsSymbolicLinks = 13 , bIsAutoMounted = 14 , bAllowCDiDataHandler } |
| enum | { kLargeIcon = 1 , kLarge4BitIcon = 2 , kLarge8BitIcon = 3 , kSmallIcon = 4 , kSmall4BitIcon = 5 , kSmall8BitIcon = 6 , kicnsIconFamily } |
| enum | { kLargeIconSize = 256 , kLarge4BitIconSize = 512 , kLarge8BitIconSize = 1024 , kSmallIconSize = 64 , kSmall4BitIconSize = 128 , kSmall8BitIconSize = 256 } |
| enum | { kWidePosOffsetBit = 8 , kUseWidePositioning = (1 << kWidePosOffsetBit) , kMaximumBlocksIn4GB = 0x007FFFFF } |
| enum | { fsUnixPriv = 1 } |
| enum | { kNoUserAuthentication = 1 , kPassword = 2 , kEncryptPassword = 3 , kTwoWayEncryptPassword = 6 } |
| enum | { kOwnerID2Name = 1 , kGroupID2Name = 2 , kOwnerName2ID = 3 , kGroupName2ID , kReturnNextUser = 1 , kReturnNextGroup = 2 , kReturnNextUG = 3 } |
| enum | { kVCBFlagsIdleFlushBit = 3 , kVCBFlagsIdleFlushMask = 0x0008 , kVCBFlagsHFSPlusAPIsBit , kVCBFlagsHFSPlusAPIsMask = 0x0010 , kVCBFlagsHardwareGoneBit , kVCBFlagsHardwareGoneMask = 0x0020 , kVCBFlagsVolumeDirtyBit , kVCBFlagsVolumeDirtyMask = 0x8000 } |
| enum | { kioVAtrbDefaultVolumeBit = 5 , kioVAtrbDefaultVolumeMask = 0x0020 , kioVAtrbFilesOpenBit = 6 , kioVAtrbFilesOpenMask = 0x0040 , kioVAtrbHardwareLockedBit , kioVAtrbHardwareLockedMask = 0x0080 , kioVAtrbSoftwareLockedBit = 15 , kioVAtrbSoftwareLockedMask = 0x8000 } |
| enum | { kioFlAttribLockedBit = 0 , kioFlAttribLockedMask = 0x01 , kioFlAttribResOpenBit = 2 , kioFlAttribResOpenMask = 0x04 , kioFlAttribDataOpenBit = 3 , kioFlAttribDataOpenMask = 0x08 , kioFlAttribDirBit = 4 , kioFlAttribDirMask = 0x10 , ioDirFlg = 4 , ioDirMask = 0x10 , kioFlAttribCopyProtBit , kioFlAttribCopyProtMask = 0x40 , kioFlAttribFileOpenBit = 7 , kioFlAttribFileOpenMask = 0x80 , kioFlAttribInSharedBit = 2 , kioFlAttribInSharedMask = 0x04 , kioFlAttribMountedBit = 3 , kioFlAttribMountedMask = 0x08 , kioFlAttribSharePointBit = 5 , kioFlAttribSharePointMask = 0x20 } |
| enum | { kioFCBWriteBit = 8 , kioFCBWriteMask = 0x0100 , kioFCBResourceBit = 9 , kioFCBResourceMask = 0x0200 , kioFCBWriteLockedBit = 10 , kioFCBWriteLockedMask = 0x0400 , kioFCBLargeFileBit , kioFCBLargeFileMask = 0x0800 , kioFCBSharedWriteBit = 12 , kioFCBSharedWriteMask = 0x1000 , kioFCBFileLockedBit = 13 , kioFCBFileLockedMask = 0x2000 , kioFCBOwnClumpBit = 14 , kioFCBOwnClumpMask = 0x4000 , kioFCBModifiedBit = 15 , kioFCBModifiedMask = 0x8000 } |
| enum | { kioACUserNoSeeFolderBit , kioACUserNoSeeFolderMask = 0x01 , kioACUserNoSeeFilesBit , kioACUserNoSeeFilesMask = 0x02 , kioACUserNoMakeChangesBit , kioACUserNoMakeChangesMask = 0x04 , kioACUserNotOwnerBit = 7 , kioACUserNotOwnerMask = 0x80 } |
| enum | { kioACAccessOwnerBit = 31 , kioACAccessOwnerMask = (long)0x80000000 , kioACAccessBlankAccessBit = 28 , kioACAccessBlankAccessMask = 0x10000000 , kioACAccessUserWriteBit = 26 , kioACAccessUserWriteMask = 0x04000000 , kioACAccessUserReadBit = 25 , kioACAccessUserReadMask = 0x02000000 , kioACAccessUserSearchBit = 24 , kioACAccessUserSearchMask = 0x01000000 , kioACAccessEveryoneWriteBit = 18 , kioACAccessEveryoneWriteMask = 0x00040000 , kioACAccessEveryoneReadBit = 17 , kioACAccessEveryoneReadMask = 0x00020000 , kioACAccessEveryoneSearchBit = 16 , kioACAccessEveryoneSearchMask = 0x00010000 , kioACAccessGroupWriteBit = 10 , kioACAccessGroupWriteMask = 0x00000400 , kioACAccessGroupReadBit = 9 , kioACAccessGroupReadMask = 0x00000200 , kioACAccessGroupSearchBit = 8 , kioACAccessGroupSearchMask = 0x00000100 , kioACAccessOwnerWriteBit = 2 , kioACAccessOwnerWriteMask = 0x00000004 , kioACAccessOwnerReadBit = 1 , kioACAccessOwnerReadMask = 0x00000002 , kioACAccessOwnerSearchBit = 0 , kioACAccessOwnerSearchMask = 0x00000001 , kfullPrivileges = 0x00070007 , kownerPrivileges = 0x00000007 } |
| enum | { knoUser = 0 , kadministratorUser = 1 } |
| enum | { knoGroup = 0 } |
| enum | { uppIOCompletionProcInfo = 0x00009802 } |
| enum | { kFSInvalidVolumeRefNum = 0 } |
| enum | { kFSCatInfoNone = 0x00000000 , kFSCatInfoTextEncoding = 0x00000001 , kFSCatInfoNodeFlags , kFSCatInfoVolume = 0x00000004 , kFSCatInfoParentDirID = 0x00000008 , kFSCatInfoNodeID = 0x00000010 , kFSCatInfoCreateDate = 0x00000020 , kFSCatInfoContentMod = 0x00000040 , kFSCatInfoAttrMod = 0x00000080 , kFSCatInfoAccessDate = 0x00000100 , kFSCatInfoBackupDate = 0x00000200 , kFSCatInfoPermissions = 0x00000400 , kFSCatInfoFinderInfo = 0x00000800 , kFSCatInfoFinderXInfo = 0x00001000 , kFSCatInfoValence = 0x00002000 , kFSCatInfoDataSizes = 0x00004000 , kFSCatInfoRsrcSizes , kFSCatInfoSharingFlags = 0x00010000 , kFSCatInfoUserPrivs = 0x00020000 , kFSCatInfoUserAccess = 0x00080000 , kFSCatInfoAllDates = 0x000003E0 , kFSCatInfoGettableInfo = 0x0003FFFF , kFSCatInfoSettableInfo , kFSCatInfoReserved = (long)0xFFFC0000 } |
| enum | { kFSNodeLockedBit = 0 , kFSNodeLockedMask = 0x0001 , kFSNodeResOpenBit = 2 , kFSNodeResOpenMask = 0x0004 , kFSNodeDataOpenBit = 3 , kFSNodeDataOpenMask = 0x0008 , kFSNodeIsDirectoryBit = 4 , kFSNodeIsDirectoryMask = 0x0010 , kFSNodeCopyProtectBit = 6 , kFSNodeCopyProtectMask = 0x0040 , kFSNodeForkOpenBit = 7 , kFSNodeForkOpenMask = 0x0080 } |
| enum | { kFSNodeInSharedBit = 2 , kFSNodeInSharedMask = 0x0004 , kFSNodeIsMountedBit = 3 , kFSNodeIsMountedMask = 0x0008 , kFSNodeIsSharePointBit , kFSNodeIsSharePointMask = 0x0020 } |
| enum | { kFSIterateFlat = 0 , kFSIterateSubtree = 1 , kFSIterateDelete = 2 , kFSIterateReserved = (long)0xFFFFFFFC } |
| enum | { fsSBNodeID = 0x00008000 , fsSBAttributeModDate = 0x00010000 , fsSBAccessDate = 0x00020000 , fsSBPermissions = 0x00040000 , fsSBNodeIDBit = 15 , fsSBAttributeModDateBit = 16 , fsSBAccessDateBit = 17 , fsSBPermissionsBit = 18 } |
| enum | { kFSAllocDefaultFlags = 0x0000 , kFSAllocAllOrNothingMask = 0x0001 , kFSAllocContiguousMask = 0x0002 , kFSAllocNoRoundUpMask = 0x0004 , kFSAllocReservedMask } |
| enum | { kFSVolInfoNone = 0x0000 , kFSVolInfoCreateDate = 0x0001 , kFSVolInfoModDate = 0x0002 , kFSVolInfoBackupDate = 0x0004 , kFSVolInfoCheckedDate = 0x0008 , kFSVolInfoFileCount = 0x0010 , kFSVolInfoDirCount = 0x0020 , kFSVolInfoSizes = 0x0040 , kFSVolInfoBlocks = 0x0080 , kFSVolInfoNextAlloc = 0x0100 , kFSVolInfoRsrcClump = 0x0200 , kFSVolInfoDataClump = 0x0400 , kFSVolInfoNextID = 0x0800 , kFSVolInfoFinderInfo = 0x1000 , kFSVolInfoFlags = 0x2000 , kFSVolInfoFSInfo = 0x4000 , kFSVolInfoDriveInfo = 0x8000 , kFSVolInfoGettableInfo , kFSVolInfoSettableInfo = 0x3004 } |
| enum | { kFSVolFlagDefaultVolumeBit = 5 , kFSVolFlagDefaultVolumeMask = 0x0020 , kFSVolFlagFilesOpenBit = 6 , kFSVolFlagFilesOpenMask = 0x0040 , kFSVolFlagHardwareLockedBit , kFSVolFlagHardwareLockedMask = 0x0080 , kFSVolFlagSoftwareLockedBit = 15 , kFSVolFlagSoftwareLockedMask = 0x8000 } |
| enum | { kFNDirectoryModifiedMessage = 1 } |
| enum | { kFNNoImplicitAllSubscription = (1 << 0) } |
| enum | { uppFNSubscriptionProcInfo = 0x00003FC1 } |
Functions | |
| typedef | CALLBACK_API_REGISTER68K (void, IOCompletionProcPtr,(ParmBlkPtr paramBlock)) |
| typedef | REGISTER_UPP_TYPE (IOCompletionProcPtr) IOCompletionUPP |
| IOCompletionUPP | NewIOCompletionUPP (IOCompletionProcPtr userRoutine) |
| void | DisposeIOCompletionUPP (IOCompletionUPP userUPP) |
| void | InvokeIOCompletionUPP (ParmBlkPtr paramBlock, IOCompletionUPP userUPP) |
| OSErr | PBGetVInfoSync (ParmBlkPtr paramBlock) |
| OSErr | PBGetVInfoAsync (ParmBlkPtr paramBlock) |
| OSErr | PBXGetVolInfoSync (XVolumeParamPtr paramBlock) |
| OSErr | PBXGetVolInfoAsync (XVolumeParamPtr paramBlock) |
| OSErr | PBGetVolSync (ParmBlkPtr paramBlock) |
| OSErr | PBGetVolAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetVolSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetVolAsync (ParmBlkPtr paramBlock) |
| OSErr | PBFlushVolSync (ParmBlkPtr paramBlock) |
| OSErr | PBFlushVolAsync (ParmBlkPtr paramBlock) |
| OSErr | PBHTrashVolumeCachesSync (ParmBlkPtr paramBlock) |
| OSErr | PBCreateSync (ParmBlkPtr paramBlock) |
| OSErr | PBCreateAsync (ParmBlkPtr paramBlock) |
| OSErr | PBDeleteSync (ParmBlkPtr paramBlock) |
| OSErr | PBDeleteAsync (ParmBlkPtr paramBlock) |
| OSErr | PBOpenDFSync (ParmBlkPtr paramBlock) |
| OSErr | PBOpenDFAsync (ParmBlkPtr paramBlock) |
| OSErr | PBOpenRFSync (ParmBlkPtr paramBlock) |
| OSErr | PBOpenRFAsync (ParmBlkPtr paramBlock) |
| OSErr | PBRenameSync (ParmBlkPtr paramBlock) |
| OSErr | PBRenameAsync (ParmBlkPtr paramBlock) |
| OSErr | PBGetFInfoSync (ParmBlkPtr paramBlock) |
| OSErr | PBGetFInfoAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFInfoSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFInfoAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFLockSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFLockAsync (ParmBlkPtr paramBlock) |
| OSErr | PBRstFLockSync (ParmBlkPtr paramBlock) |
| OSErr | PBRstFLockAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFVersSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFVersAsync (ParmBlkPtr paramBlock) |
| OSErr | PBAllocateSync (ParmBlkPtr paramBlock) |
| OSErr | PBAllocateAsync (ParmBlkPtr paramBlock) |
| OSErr | PBGetEOFSync (ParmBlkPtr paramBlock) |
| OSErr | PBGetEOFAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetEOFSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetEOFAsync (ParmBlkPtr paramBlock) |
| OSErr | PBGetFPosSync (ParmBlkPtr paramBlock) |
| OSErr | PBGetFPosAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFPosSync (ParmBlkPtr paramBlock) |
| OSErr | PBSetFPosAsync (ParmBlkPtr paramBlock) |
| OSErr | PBFlushFileSync (ParmBlkPtr paramBlock) |
| OSErr | PBFlushFileAsync (ParmBlkPtr paramBlock) |
| OSErr | PBMountVol (ParmBlkPtr paramBlock) |
| OSErr | PBUnmountVol (ParmBlkPtr paramBlock) |
| Flush volume, close its files, release its memory. More... | |
| OSErr | PBUnmountVolImmed (ParmBlkPtr paramBlock) |
| OSErr | PBEject (ParmBlkPtr paramBlock) |
| OSErr | PBOffLine (ParmBlkPtr paramBlock) |
| OSErr | PBCatSearchSync (CSParamPtr paramBlock) |
| OSErr | PBCatSearchAsync (CSParamPtr paramBlock) |
| The volName string should NOT be a multiple name | pathname (such as "\pHardDisk:Ltrs:Old") nor should it be an empty string(i.e. |
| this parameter is checked first and anything but a valid | name (except a NIL pointer) is rejected as an error.PBHSetVol lets you select both the default volume and default directory(see the second example |
| this parameter is checked first and anything but a valid below You can pass a working directory | number (i.e., the value of ioVRefNum after a call to PBOpenWD, or a volume reference returned by Standard File) |
| this parameter is checked first and anything but a valid below You can pass a working directory but only if volName is NIL on | entry (see the third example).Also |
| OSErr | UnmountVol (ConstStr63Param volName, short vRefNum) |
| Flush volume, close its files, release its memory. More... | |
| OSErr | Eject (ConstStr63Param volName, short vRefNum) |
| OSErr | FlushVol (ConstStr63Param volName, short vRefNum) |
| OSErr | HSetVol (ConstStr63Param volName, short vRefNum, long dirID) |
| Select a default default volume/directory (HFS only) More... | |
| OSErr | FSOpen (ConstStr255Param fileName, short vRefNum, short *refNum) |
| Open the data fork of an existing file. More... | |
| OSErr | OpenDF (ConstStr255Param fileName, short vRefNum, short *refNum) |
| OSErr | FSClose (short refNum) |
| Close a file. More... | |
| OSErr | FSRead (short refNum, long *count, void *buffPtr) |
| Read from an open file or device driver. More... | |
| OSErr | FSWrite (short refNum, long *count, const void *buffPtr) |
| Write data from memory to a file. More... | |
| OSErr | GetFInfo (ConstStr255Param fileName, short vRefNum, FInfo *fndrInfo) |
| Obtain file type, creator, icon position, etc. More... | |
| OSErr | GetVol (StringPtr volName, short *vRefNum) |
| Obtain name and reference number of default volume. More... | |
| OSErr | Create (ConstStr255Param fileName, short vRefNum, OSType creator, OSType fileType) |
| a new empty file (data fork only) More... | |
| if (rc) | |
| Delete an unopened file or empty directory. More... | |
| OSErr | OpenRF (ConstStr255Param fileName, short vRefNum, short *refNum) |
| OSErr | Rename (ConstStr255Param oldName, short vRefNum, ConstStr255Param newName) |
| Change the name of a file or directory. More... | |
| OSErr | SetFInfo (ConstStr255Param fileName, short vRefNum, const FInfo *fndrInfo) |
| Change file type, creator, icon position, etc. More... | |
| OSErr | SetFLock (ConstStr255Param fileName, short vRefNum) |
| Lock a file (prevent changes, deletion, renaming, etc.) More... | |
| OSErr | RstFLock (ConstStr255Param fileName, short vRefNum) |
| Unlock a file (allow changes, deletion, renaming, etc.) More... | |
| This attempts to extend the file by but it will always eat up one full allocation | unit (e.g., 512 or 1K) of disk space. Before using Allocate |
| if (hData==0) | |
| OSErr | SetEOF (short refNum, long logEOF) |
| Increase or decrease the logical size of a file. More... | |
| OSErr | GetFPos (short refNum, long *filePos) |
| Obtain position of the file mark of an open file. More... | |
| OSErr | SetFPos (short refNum, short posMode, long posOff) |
| Position file mark for random-access read/write. More... | |
| OSErr | GetVRefNum (short fileRefNum, short *vRefNum) |
| Get volume reference number of an open file. More... | |
| OSErr | fsopen (const char *fileName, short vRefNum, short *refNum) |
| OSErr | getvinfo (short drvNum, char *volName, short *vRefNum, long *freeBytes) |
| OSErr | getfinfo (const char *fileName, short vRefNum, FInfo *fndrInfo) |
| OSErr | getvol (char *volName, short *vRefNum) |
| OSErr | setvol (const char *volName, short vRefNum) |
| OSErr | unmountvol (const char *volName, short vRefNum) |
| OSErr | eject (const char *volName, short vRefNum) |
| OSErr | flushvol (const char *volName, short vRefNum) |
| OSErr | create (const char *fileName, short vRefNum, OSType creator, OSType fileType) |
| OSErr | fsdelete (const char *fileName, short vRefNum) |
| OSErr | openrf (const char *fileName, short vRefNum, short *refNum) |
| OSErr | fsrename (const char *oldName, short vRefNum, const char *newName) |
| OSErr | setfinfo (const char *fileName, short vRefNum, const FInfo *fndrInfo) |
| OSErr | setflock (const char *fileName, short vRefNum) |
| OSErr | rstflock (const char *fileName, short vRefNum) |
| OSErr | PBOpenWDSync (WDPBPtr paramBlock) |
| OSErr | PBOpenWDAsync (WDPBPtr paramBlock) |
| OSErr | PBCloseWDSync (WDPBPtr paramBlock) |
| OSErr | PBCloseWDAsync (WDPBPtr paramBlock) |
| OSErr | PBHSetVolSync (WDPBPtr paramBlock) |
| OSErr | PBHSetVolAsync (WDPBPtr paramBlock) |
| OSErr | PBHGetVolSync (WDPBPtr paramBlock) |
| OSErr | PBHGetVolAsync (WDPBPtr paramBlock) |
| OSErr | PBCatMoveSync (CMovePBPtr paramBlock) |
| OSErr | PBCatMoveAsync (CMovePBPtr paramBlock) |
| OSErr | PBDirCreateSync (HParmBlkPtr paramBlock) |
| OSErr | PBDirCreateAsync (HParmBlkPtr paramBlock) |
| OSErr | PBGetWDInfoSync (WDPBPtr paramBlock) |
| OSErr | PBGetWDInfoAsync (WDPBPtr paramBlock) |
| OSErr | PBGetFCBInfoSync (FCBPBPtr paramBlock) |
| OSErr | PBGetFCBInfoAsync (FCBPBPtr paramBlock) |
| OSErr | PBGetCatInfoSync (CInfoPBPtr paramBlock) |
| OSErr | PBGetCatInfoAsync (CInfoPBPtr paramBlock) |
| OSErr | PBSetCatInfoSync (CInfoPBPtr paramBlock) |
| OSErr | PBSetCatInfoAsync (CInfoPBPtr paramBlock) |
| OSErr | PBAllocContigSync (ParmBlkPtr paramBlock) |
| OSErr | PBAllocContigAsync (ParmBlkPtr paramBlock) |
| OSErr | PBLockRangeSync (ParmBlkPtr paramBlock) |
| OSErr | PBLockRangeAsync (ParmBlkPtr paramBlock) |
| OSErr | PBUnlockRangeSync (ParmBlkPtr paramBlock) |
| OSErr | PBUnlockRangeAsync (ParmBlkPtr paramBlock) |
| OSErr | PBSetVInfoSync (HParmBlkPtr paramBlock) |
| OSErr | PBSetVInfoAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetVInfoSync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetVInfoAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenSync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenRFSync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenRFAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenDFSync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenDFAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHCreateSync (HParmBlkPtr paramBlock) |
| OSErr | PBHCreateAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHDeleteSync (HParmBlkPtr paramBlock) |
| OSErr | PBHDeleteAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHRenameSync (HParmBlkPtr paramBlock) |
| OSErr | PBHRenameAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHRstFLockSync (HParmBlkPtr paramBlock) |
| OSErr | PBHRstFLockAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetFLockSync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetFLockAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetFInfoSync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetFInfoAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetFInfoSync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetFInfoAsync (HParmBlkPtr paramBlock) |
| OSErr | PBMakeFSSpecSync (HParmBlkPtr paramBlock) |
| OSErr | PBMakeFSSpecAsync (HParmBlkPtr paramBlock) |
| void | FInitQueue (void) |
| Clear enqueued File Manager calls. More... | |
| QHdrPtr | GetFSQHdr (void) |
| Obtain pointer to the file I/O queue header. More... | |
| printf ("First vcb is at = %lx\n", qhp->qHead) | |
| Obtain pointer to the volume control block queue header. More... | |
| printf ("Volume's drive # is: %d\n", vcbp->vcbDrvNum) | |
| OSErr | HGetVol (StringPtr volName, short *vRefNum, long *dirID) |
| Obtain default volume/directory name and reference. More... | |
| OSErr | HOpen (short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission, short *refNum) |
| OSErr | HOpenDF (short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission, short *refNum) |
| OSErr | HOpenRF (short vRefNum, long dirID, ConstStr255Param fileName, SInt8 permission, short *refNum) |
| OSErr | AllocContig (short refNum, long *count) |
| Allocate contiguous space on disk. More... | |
| OSErr | HCreate (short vRefNum, long dirID, ConstStr255Param fileName, OSType creator, OSType fileType) |
| Create a new file like PB and set type and creator. More... | |
| OSErr | DirCreate (short vRefNum, long parentDirID, ConstStr255Param directoryName, long *createdDirID) |
| Create a directory. More... | |
| OSErr | HDelete (short vRefNum, long dirID, ConstStr255Param fileName) |
| Delete an unopened file or empty directory. More... | |
| OSErr | HGetFInfo (short vRefNum, long dirID, ConstStr255Param fileName, FInfo *fndrInfo) |
| Obtain file type, creator, icon position, etc. More... | |
| OSErr | HSetFInfo (short vRefNum, long dirID, ConstStr255Param fileName, const FInfo *fndrInfo) |
| Change file type, creator, icon position, etc. More... | |
| OSErr | HSetFLock (short vRefNum, long dirID, ConstStr255Param fileName) |
| Lock a file (prevent changes, deletion, renaming, etc.) More... | |
| OSErr | HRstFLock (short vRefNum, long dirID, ConstStr255Param fileName) |
| Unlock a file (allow changes, deletion, renaming, etc.) More... | |
| OSErr | HRename (short vRefNum, long dirID, ConstStr255Param oldName, ConstStr255Param newName) |
| Rename a file, volume, or directory. More... | |
| OSErr | CatMove (short vRefNum, long dirID, ConstStr255Param oldName, long newDirID, ConstStr255Param newName) |
| Transfer file or directory to another directory on the same volume. More... | |
| OSErr | OpenWD (short vRefNum, long dirID, long procID, short *wdRefNum) |
| OSErr | CloseWD (short wdRefNum) |
| Close and release a working directory. More... | |
| OSErr | GetWDInfo (short wdRefNum, short *vRefNum, long *dirID, long *procID) |
| Query information about an existing working directory. More... | |
| OSErr | PBHGetVolParmsSync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetVolParmsAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetLogInInfoSync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetLogInInfoAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetDirAccessSync (HParmBlkPtr paramBlock) |
| OSErr | PBHGetDirAccessAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetDirAccessSync (HParmBlkPtr paramBlock) |
| OSErr | PBHSetDirAccessAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHMapIDSync (HParmBlkPtr paramBlock) |
| OSErr | PBHMapIDAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHMapNameSync (HParmBlkPtr paramBlock) |
| OSErr | PBHMapNameAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHCopyFileSync (HParmBlkPtr paramBlock) |
| OSErr | PBHCopyFileAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHMoveRenameSync (HParmBlkPtr paramBlock) |
| OSErr | PBHMoveRenameAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenDenySync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenDenyAsync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenRFDenySync (HParmBlkPtr paramBlock) |
| OSErr | PBHOpenRFDenyAsync (HParmBlkPtr paramBlock) |
| OSErr | PBGetXCatInfoSync (XCInfoPBPtr paramBlock) |
| OSErr | PBGetXCatInfoAsync (XCInfoPBPtr paramBlock) |
| OSErr | PBExchangeFilesSync (HParmBlkPtr paramBlock) |
| OSErr | PBExchangeFilesAsync (HParmBlkPtr paramBlock) |
| OSErr | PBCreateFileIDRefSync (HParmBlkPtr paramBlock) |
| OSErr | PBCreateFileIDRefAsync (HParmBlkPtr paramBlock) |
| OSErr | PBResolveFileIDRefSync (HParmBlkPtr paramBlock) |
| OSErr | PBResolveFileIDRefAsync (HParmBlkPtr paramBlock) |
| OSErr | PBDeleteFileIDRefSync (HParmBlkPtr paramBlock) |
| OSErr | PBDeleteFileIDRefAsync (HParmBlkPtr paramBlock) |
| OSErr | PBGetForeignPrivsSync (HParmBlkPtr paramBlock) |
| OSErr | PBGetForeignPrivsAsync (HParmBlkPtr paramBlock) |
| OSErr | PBSetForeignPrivsSync (HParmBlkPtr paramBlock) |
| OSErr | PBSetForeignPrivsAsync (HParmBlkPtr paramBlock) |
| OSErr | PBDTGetPath (DTPBPtr paramBlock) |
| OSErr | PBDTCloseDown (DTPBPtr paramBlock) |
| OSErr | PBDTAddIconSync (DTPBPtr paramBlock) |
| OSErr | PBDTAddIconAsync (DTPBPtr paramBlock) |
| OSErr | PBDTGetIconSync (DTPBPtr paramBlock) |
| OSErr | PBDTGetIconAsync (DTPBPtr paramBlock) |
| OSErr | PBDTGetIconInfoSync (DTPBPtr paramBlock) |
| OSErr | PBDTGetIconInfoAsync (DTPBPtr paramBlock) |
| OSErr | PBDTAddAPPLSync (DTPBPtr paramBlock) |
| OSErr | PBDTAddAPPLAsync (DTPBPtr paramBlock) |
| OSErr | PBDTRemoveAPPLSync (DTPBPtr paramBlock) |
| OSErr | PBDTRemoveAPPLAsync (DTPBPtr paramBlock) |
| OSErr | PBDTGetAPPLSync (DTPBPtr paramBlock) |
| OSErr | PBDTGetAPPLAsync (DTPBPtr paramBlock) |
| OSErr | PBDTSetCommentSync (DTPBPtr paramBlock) |
| OSErr | PBDTSetCommentAsync (DTPBPtr paramBlock) |
| OSErr | PBDTRemoveCommentSync (DTPBPtr paramBlock) |
| OSErr | PBDTRemoveCommentAsync (DTPBPtr paramBlock) |
| OSErr | PBDTGetCommentSync (DTPBPtr paramBlock) |
| OSErr | PBDTGetCommentAsync (DTPBPtr paramBlock) |
| OSErr | PBDTFlushSync (DTPBPtr paramBlock) |
| OSErr | PBDTFlushAsync (DTPBPtr paramBlock) |
| OSErr | PBDTResetSync (DTPBPtr paramBlock) |
| OSErr | PBDTResetAsync (DTPBPtr paramBlock) |
| OSErr | PBDTGetInfoSync (DTPBPtr paramBlock) |
| OSErr | PBDTGetInfoAsync (DTPBPtr paramBlock) |
| OSErr | PBDTOpenInform (DTPBPtr paramBlock) |
| OSErr | PBDTDeleteSync (DTPBPtr paramBlock) |
| OSErr | PBDTDeleteAsync (DTPBPtr paramBlock) |
| OSErr | PBGetVolMountInfoSize (ParmBlkPtr paramBlock) |
| PBGetVolMountInfoSize Determine space allocation for volume-mounting record. More... | |
| OSErr | PBGetVolMountInfo (ParmBlkPtr paramBlock) |
| PBGetVolMountInfo Places volume mounting information into a buffer. More... | |
| OSErr | PBVolumeMount (ParmBlkPtr paramBlock) |
| OSErr | FSMakeFSSpec (short vRefNum, long dirID, ConstStr255Param fileName, FSSpec *spec) |
| Convert a file or directory spec into an FSSpec record. More... | |
| OSErr | FSpOpenDF (const FSSpec *spec, SInt8 permission, short *refNum) |
| OSErr | FSpOpenRF (const FSSpec *spec, SInt8 permission, short *refNum) |
| OSErr | FSpCreate (const FSSpec *spec, OSType creator, OSType fileType, ScriptCode scriptTag) |
| Create a new file and set the type and creator. More... | |
| OSErr | FSpDirCreate (const FSSpec *spec, ScriptCode scriptTag, long *createdDirID) |
| Create a new directory. More... | |
| OSErr | FSpDelete (const FSSpec *spec) |
| Remove a closed file. More... | |
| OSErr | FSpGetFInfo (const FSSpec *spec, FInfo *fndrInfo) |
| Get Finder information. More... | |
| OSErr | FSpSetFInfo (const FSSpec *spec, const FInfo *fndrInfo) |
| Set the Finder information. More... | |
| OSErr | FSpSetFLock (const FSSpec *spec) |
| Lock a file. More... | |
| OSErr | FSpRstFLock (const FSSpec *spec) |
| Unlock a file. More... | |
| OSErr | FSpRename (const FSSpec *spec, ConstStr255Param newName) |
| Change a file's name. More... | |
| OSErr | FSpCatMove (const FSSpec *source, const FSSpec *dest) |
| Change a file's location. More... | |
| OSErr | FSpExchangeFiles (const FSSpec *source, const FSSpec *dest) |
| FSpExchangeFiles Swap the files' data. More... | |
| OSErr | PBShareSync (HParmBlkPtr paramBlock) |
| OSErr | PBShareAsync (HParmBlkPtr paramBlock) |
| OSErr | PBUnshareSync (HParmBlkPtr paramBlock) |
| OSErr | PBUnshareAsync (HParmBlkPtr paramBlock) |
| OSErr | PBGetUGEntrySync (HParmBlkPtr paramBlock) |
| OSErr | PBGetUGEntryAsync (HParmBlkPtr paramBlock) |
| OSErr | FSpMakeFSRef (const FSSpec *source, FSRef *newRef) |
| OSErr | PBMakeFSRefSync (FSRefParam *paramBlock) |
| void | PBMakeFSRefAsync (FSRefParam *paramBlock) |
| OSErr | FSMakeFSRefUnicode (const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, TextEncoding textEncodingHint, FSRef *newRef) |
| OSErr | PBMakeFSRefUnicodeSync (FSRefParam *paramBlock) |
| void | PBMakeFSRefUnicodeAsync (FSRefParam *paramBlock) |
| OSErr | FSCompareFSRefs (const FSRef *ref1, const FSRef *ref2) |
| OSErr | PBCompareFSRefsSync (FSRefParam *paramBlock) |
| void | PBCompareFSRefsAsync (FSRefParam *paramBlock) |
| OSErr | FSCreateFileUnicode (const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, FSRef *newRef, FSSpec *newSpec) |
| OSErr | PBCreateFileUnicodeSync (FSRefParam *paramBlock) |
| void | PBCreateFileUnicodeAsync (FSRefParam *paramBlock) |
| OSErr | FSCreateDirectoryUnicode (const FSRef *parentRef, UniCharCount nameLength, const UniChar *name, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo, FSRef *newRef, FSSpec *newSpec, UInt32 *newDirID) |
| OSErr | PBCreateDirectoryUnicodeSync (FSRefParam *paramBlock) |
| void | PBCreateDirectoryUnicodeAsync (FSRefParam *paramBlock) |
| OSErr | FSDeleteObject (const FSRef *ref) |
| OSErr | PBDeleteObjectSync (FSRefParam *paramBlock) |
| void | PBDeleteObjectAsync (FSRefParam *paramBlock) |
| OSErr | FSMoveObject (const FSRef *ref, const FSRef *destDirectory, FSRef *newRef) |
| OSErr | PBMoveObjectSync (FSRefParam *paramBlock) |
| void | PBMoveObjectAsync (FSRefParam *paramBlock) |
| OSErr | FSExchangeObjects (const FSRef *ref, const FSRef *destRef) |
| OSErr | PBExchangeObjectsSync (FSRefParam *paramBlock) |
| void | PBExchangeObjectsAsync (FSRefParam *paramBlock) |
| OSErr | FSRenameUnicode (const FSRef *ref, UniCharCount nameLength, const UniChar *name, TextEncoding textEncodingHint, FSRef *newRef) |
| OSErr | PBRenameUnicodeSync (FSRefParam *paramBlock) |
| void | PBRenameUnicodeAsync (FSRefParam *paramBlock) |
| OSErr | FSGetCatalogInfo (const FSRef *ref, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfo, HFSUniStr255 *outName, FSSpec *fsSpec, FSRef *parentRef) |
| OSErr | PBGetCatalogInfoSync (FSRefParam *paramBlock) |
| void | PBGetCatalogInfoAsync (FSRefParam *paramBlock) |
| OSErr | FSSetCatalogInfo (const FSRef *ref, FSCatalogInfoBitmap whichInfo, const FSCatalogInfo *catalogInfo) |
| OSErr | PBSetCatalogInfoSync (FSRefParam *paramBlock) |
| void | PBSetCatalogInfoAsync (FSRefParam *paramBlock) |
| OSErr | FSOpenIterator (const FSRef *container, FSIteratorFlags iteratorFlags, FSIterator *iterator) |
| OSErr | PBOpenIteratorSync (FSCatalogBulkParam *paramBlock) |
| void | PBOpenIteratorAsync (FSCatalogBulkParam *paramBlock) |
| OSErr | FSCloseIterator (FSIterator iterator) |
| OSErr | PBCloseIteratorSync (FSCatalogBulkParam *paramBlock) |
| void | PBCloseIteratorAsync (FSCatalogBulkParam *paramBlock) |
| OSErr | FSGetCatalogInfoBulk (FSIterator iterator, ItemCount maximumObjects, ItemCount *actualObjects, Boolean *containerChanged, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfos, FSRef *refs, FSSpec *specs, HFSUniStr255 *names) |
| OSErr | PBGetCatalogInfoBulkSync (FSCatalogBulkParam *paramBlock) |
| void | PBGetCatalogInfoBulkAsync (FSCatalogBulkParam *paramBlock) |
| OSErr | FSCatalogSearch (FSIterator iterator, const FSSearchParams *searchCriteria, ItemCount maximumObjects, ItemCount *actualObjects, Boolean *containerChanged, FSCatalogInfoBitmap whichInfo, FSCatalogInfo *catalogInfos, FSRef *refs, FSSpec *specs, HFSUniStr255 *names) |
| OSErr | PBCatalogSearchSync (FSCatalogBulkParam *paramBlock) |
| void | PBCatalogSearchAsync (FSCatalogBulkParam *paramBlock) |
| OSErr | FSCreateFork (const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName) |
| OSErr | PBCreateForkSync (FSForkIOParam *paramBlock) |
| void | PBCreateForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSDeleteFork (const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName) |
| OSErr | PBDeleteForkSync (FSForkIOParam *paramBlock) |
| void | PBDeleteForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSIterateForks (const FSRef *ref, CatPositionRec *forkIterator, HFSUniStr255 *forkName, SInt64 *forkSize, UInt64 *forkPhysicalSize) |
| OSErr | PBIterateForksSync (FSForkIOParam *paramBlock) |
| void | PBIterateForksAsync (FSForkIOParam *paramBlock) |
| OSErr | FSOpenFork (const FSRef *ref, UniCharCount forkNameLength, const UniChar *forkName, SInt8 permissions, SInt16 *forkRefNum) |
| OSErr | PBOpenForkSync (FSForkIOParam *paramBlock) |
| void | PBOpenForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSReadFork (SInt16 forkRefNum, UInt16 positionMode, SInt64 positionOffset, ByteCount requestCount, void *buffer, ByteCount *actualCount) |
| OSErr | PBReadForkSync (FSForkIOParam *paramBlock) |
| void | PBReadForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSWriteFork (SInt16 forkRefNum, UInt16 positionMode, SInt64 positionOffset, ByteCount requestCount, const void *buffer, ByteCount *actualCount) |
| OSErr | PBWriteForkSync (FSForkIOParam *paramBlock) |
| void | PBWriteForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSGetForkPosition (SInt16 forkRefNum, SInt64 *position) |
| OSErr | PBGetForkPositionSync (FSForkIOParam *paramBlock) |
| void | PBGetForkPositionAsync (FSForkIOParam *paramBlock) |
| OSErr | FSSetForkPosition (SInt16 forkRefNum, UInt16 positionMode, SInt64 positionOffset) |
| OSErr | PBSetForkPositionSync (FSForkIOParam *paramBlock) |
| void | PBSetForkPositionAsync (FSForkIOParam *paramBlock) |
| OSErr | FSGetForkSize (SInt16 forkRefNum, SInt64 *forkSize) |
| OSErr | PBGetForkSizeSync (FSForkIOParam *paramBlock) |
| void | PBGetForkSizeAsync (FSForkIOParam *paramBlock) |
| OSErr | FSSetForkSize (SInt16 forkRefNum, UInt16 positionMode, SInt64 positionOffset) |
| OSErr | PBSetForkSizeSync (FSForkIOParam *paramBlock) |
| void | PBSetForkSizeAsync (FSForkIOParam *paramBlock) |
| OSErr | FSAllocateFork (SInt16 forkRefNum, FSAllocationFlags flags, UInt16 positionMode, SInt64 positionOffset, UInt64 requestCount, UInt64 *actualCount) |
| OSErr | PBAllocateForkSync (FSForkIOParam *paramBlock) |
| void | PBAllocateForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSFlushFork (SInt16 forkRefNum) |
| OSErr | PBFlushForkSync (FSForkIOParam *paramBlock) |
| void | PBFlushForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSCloseFork (SInt16 forkRefNum) |
| OSErr | PBCloseForkSync (FSForkIOParam *paramBlock) |
| void | PBCloseForkAsync (FSForkIOParam *paramBlock) |
| OSErr | FSGetForkCBInfo (SInt16 desiredRefNum, FSVolumeRefNum volume, SInt16 *iterator, SInt16 *actualRefNum, FSForkInfo *forkInfo, FSRef *ref, HFSUniStr255 *outForkName) |
| OSErr | PBGetForkCBInfoSync (FSForkCBInfoParam *paramBlock) |
| void | PBGetForkCBInfoAsync (FSForkCBInfoParam *paramBlock) |
| OSErr | FSGetVolumeInfo (FSVolumeRefNum volume, ItemCount volumeIndex, FSVolumeRefNum *actualVolume, FSVolumeInfoBitmap whichInfo, FSVolumeInfo *info, HFSUniStr255 *volumeName, FSRef *rootDirectory) |
| OSErr | PBGetVolumeInfoSync (FSVolumeInfoParam *paramBlock) |
| void | PBGetVolumeInfoAsync (FSVolumeInfoParam *paramBlock) |
| OSErr | FSSetVolumeInfo (FSVolumeRefNum volume, FSVolumeInfoBitmap whichInfo, const FSVolumeInfo *info) |
| OSErr | PBSetVolumeInfoSync (FSVolumeInfoParam *paramBlock) |
| void | PBSetVolumeInfoAsync (FSVolumeInfoParam *paramBlock) |
| OSErr | FSGetDataForkName (HFSUniStr255 *dataForkName) |
| OSErr | FSGetResourceForkName (HFSUniStr255 *resourceForkName) |
| OSStatus | FSRefMakePath (const FSRef *ref, UInt8 *path, UInt32 maxPathSize) |
| OSStatus | FSPathMakeRef (const UInt8 *path, FSRef *ref, Boolean *isDirectory) |
| OSStatus | FNNotify (const FSRef *ref, FNMessage message, OptionBits flags) |
| OSStatus | FNNotifyByPath (const UInt8 *path, FNMessage message, OptionBits flags) |
| OSStatus | FNNotifyAll (FNMessage message, OptionBits flags) |
| typedef | CALLBACK_API_C (void, FNSubscriptionProcPtr)(FNMessage message |
| typedef | TVECTOR_UPP_TYPE (FNSubscriptionProcPtr) FNSubscriptionUPP |
| FNSubscriptionUPP | NewFNSubscriptionUPP (FNSubscriptionProcPtr userRoutine) |
| void | DisposeFNSubscriptionUPP (FNSubscriptionUPP userUPP) |
| void | InvokeFNSubscriptionUPP (FNMessage message, OptionBits flags, void *refcon, FNSubscriptionRef subscription, FNSubscriptionUPP userUPP) |
| OSStatus | FNSubscribe (const FSRef *directoryRef, FNSubscriptionUPP callback, void *refcon, OptionBits flags, FNSubscriptionRef *subscription) |
| OSStatus | FNSubscribeByPath (const UInt8 *directoryPath, FNSubscriptionUPP callback, void *refcon, OptionBits flags, FNSubscriptionRef *subscription) |
| OSStatus | FNUnsubscribe (FNSubscriptionRef subscription) |
| OSStatus | FNGetDirectoryForSubscription (FNSubscriptionRef subscription, FSRef *ref) |
Variables | |
| HIOParam * | hipb = (HIOParam *)&hpb |
| HFileParam * | hfpb = (HFileParam *)&hpb |
| HVolumeParam * | hvpb = (HVolumeParam *)&hpb |
| AccessParam * | hapb = (AccessParam *)&hpb |
| ObjParam * | hopb = (ObjParam *)&hpb |
| CopyParam * | hcpb = (CopyParam *)&hpb |
| WDParam * | hwpb = (WDParam *)&hpb |
| hpb ioParam | ioVRefNum = 2 |
| hpb fileParam ioFlFndrInfo | fdType = 'TEXT' |
| hpb volumeParam | ioVolIndex = 0 |
| hpb accessParam | ioDenyModes = 0 |
| hpb objParam | ioObjType = 2 |
| hpb copyParam | ioDstVRefNum = 1 |
| hpb wdParam | ioWDIndex = 1 |
| </pre > *par | Copyright |
| HFileParam | fileParam |
| HVolumeParam | volumeParam |
| AccessParam | accessParam |
| ObjParam | objParam |
| CopyParam | copyParam |
| WDParam | wdParam |
| FIDParam | fidParam |
| CSParam | csParam |
| ForeignPrivParam | foreignPrivParam |
| err = SetVol("\pMy HardDisk:", 0) | |
| Select a new default volume or working directory. More... | |
| The volName string should NOT be a multiple name | p |
| this parameter is checked first and anything but a valid below You can pass a working directory but only if volName is NIL on if you do use a working directory | reference |
| this parameter is checked first and anything but a valid below You can pass a working directory but only if volName is NIL on if you do use a working directory a subsequent call to GetVol will return that | number |
| this parameter is checked first and anything but a valid below You can pass a working directory but only if volName is NIL on if you do use a working directory a subsequent call to GetVol will return that rather than a hard volume ID</pre > *par short | vRefNum |
| Str255 | volName |
| Get volume name, reference number and free bytes. More... | |
| short | vRef |
| short | rc = FSDelete("\pHardDisk:Ltrs:", 0) |
| Obtain the size of an open file (logical EOF) More... | |
| long | avail |
| </pre > *par StringPtr short long * | freeBytes |
| This attempts to extend the file by | byte |
| Increase the physical size of an open file. More... | |
| hData = NewHandle(fileSize) | |
| </pre > *par long * | logEOF |
| vcbp = (VCB *)qhp->qHead | |
File Manager (MFS, HFS, and HFS+) Interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define NewIOCompletionUPP | ( | userRoutine | ) |
| #define PBGetVInfo | ( | pb, | |
| async | |||
| ) | ((async) ? PBGetVInfoAsync(pb) : PBGetVInfoSync(pb)) |
The PBxxx() routines are obsolete.
Use the PBxxxSync() or PBxxxAsync() version instead.
| typedef UInt32 FNMessage |
FNMessage
Discussion: Messages broadcast about a directory. If system clients (such as the Finder) are interested in changes to a directory, they will receive notifications when application code broadcasts change messages about that directory.
| typedef struct OpaqueFNSubscriptionRef* FNSubscriptionRef |
FNSubscriptionRef
Discussion: A token associated with a notification subscription. The subscriber gets one back when they subscribe to notifications for a particular directory, and they supply it when the unsubscribe. It is also delivered along with the notifications for that subscription.
(size of aggregate - largest struct in
| union ParamBlockRec ParamBlockRec |
(size of aggregate)
| anonymous enum |
Discussion: Options that can be specified at subscription time.
| OSErr AllocContig | ( | short | refNum, |
| long * | count | ||
| ) |
Allocate contiguous space on disk.
AllocContig works the same way as the Allocate routine except that it allocates contiguous space on the disk for the specified file. If the required space cannot be allocated, a dskFullErr (-35) is returned. refNum is the reference number of an open file. See FSOpen and OpenRF . countis the address of a positive long integer. On entry, it specifies how much space, in bytes, you wish to add to the file's physical allocation. Upon return, it contains the actual number of bytes added (it will be a multiple of the disk block size).
an operating system Error Code . It will be one of: noErr(0) No error dskFulErr (-34) Disk full fLckdErr (-45) File is locked fnOpnErr (-38) File not open ioErr(-36) I/O error rfNumErr (-51) Bad fRefNum vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected wrPermErr (-61) Write permission error
| typedef CALLBACK_API_C | ( | void | , |
| FNSubscriptionProcPtr | |||
| ) |
FNSubscriptionProcPtr
Discussion: Callback delivered for directory notifications.
Parameters:
message: An indication of what happened
flags: Options about delivery of the notification (typically kNilOptions)
refcon: User reference supplied with subscription
subscription: Subscription corresponding to this notification
| OSErr CatMove | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | oldName, | ||
| long | newDirID, | ||
| ConstStr255Param | newName | ||
| ) |
Transfer file or directory to another directory on the same volume.
CatMove moves the directory entry of a file or directory into a different directory on the same volume. File contents are not transferred; this is strictly a directory-modification operation. It is similar to the PBCatMove routine, but it takes a vRefNum, dirID's and filenames instead of a complicated CMovePBRec structure.
an operating system Error Code . It will be one of: noErr(0) No error badMovErr (-122) Can't move into offspring bdNamErr (-37) Bad file name or attempt to move into file dupFNErr (-48) Duplicate filename (destination file/dir already exists) fnfErr(-43) Source file not found ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) No default volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The file or directory specified by ioNamePtr, ioVRefNum, and ioDirID (in various combinations), is transferred to the directory identified by ioNewName and/or ioNewDirID. CatMove cannot transfer between different disks (volumes) nor can it rename an item - use PBHRename for that.
| OSErr CloseWD | ( | short | wdRefNum | ) |
Close and release a working directory.
CloseWD closes a working directory.
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume
You should only call CloseWD or PBCloseWD on working directories you have created. Do not call CloseWD or PBCloseWD on working directories created by Standard File or SysEnvirons .
| OSErr create | ( | const char * | fileName, |
| short | vRefNum, | ||
| OSType | creator, | ||
| OSType | fileType | ||
| ) |
| OSErr Create | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| OSType | creator, | ||
| OSType | fileType | ||
| ) |
a new empty file (data fork only)
Create creates a new file with an empty data fork and initializes the
information the Finder will need to start your application if the file is clicked
from the desktop. Note that the file is NOT opened. No resource fork for the
file is created.
fileName is the address of a length-prefixed, pascal-style string containing
the name of the file to be created. It may be a partial or full
pathname, depending upon the value of vRefNum . You should NOT use
names beginning with a period (".") since that convention is reserved
for devices. Imagine what happens when you create and write to a
file named ".Sony" (it's not a pretty sight when your hard disk goes
south).
vRefNum is the reference number of the volume or directory containing
fileName . See FSOpen for a description of the options.
creatoris a 32-bit value, often expressed as a four-letter literal (e.g.,
'MSWD'). It is normally the unique signature of your application
(as registered with Apple), or the signature of the application you
want to be launched when this file is double-clicked in the Finder.
Note: use creator = '????' if you don't want the file to auto-start
any application.
fileType is a 32-bit value, normally expressed as a four-letter literal (e.g.,
'TEXT'). It identifies the file type, which helps applications
determine how to process the file. This value is used in file filtering
(see SFGetFile , et.al).
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dupFNErr (-48) Duplicate filename (rename) extFSErr (-58) External file system ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
Use SetFInfo for control over other descriptive information about the file, such as the Finder's placement of the file's icon in its folder, whether or not the file has a bundle of descriptive resources, and whether the file's icon is invisible.
| OSErr DirCreate | ( | short | vRefNum, |
| long | parentDirID, | ||
| ConstStr255Param | directoryName, | ||
| long * | createdDirID | ||
| ) |
Create a directory.
DirCreate creates a directory. It returns the new directory ID in the
createdDirID parameter.
vRefNum is the reference number of the volume or directory
containing fileName . See FSOpen for a description of the options.
parentID is the reference number of the directory that will hold the
newly created directory.
dirName is the address of a length-prefixed, pascal-style string
containing the name of the directory to be created. You should NOT
use names beginning with a period ('.') since that convention is
reserved for devices.
createdDirID is the ID of the newly created directory.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dupFNErr (-48) Duplicate filename (rename) extFSErr (-58) External file system ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
| void DisposeFNSubscriptionUPP | ( | FNSubscriptionUPP | userUPP | ) |
| void DisposeIOCompletionUPP | ( | IOCompletionUPP | userUPP | ) |
| OSErr eject | ( | const char * | volName, |
| short | vRefNum | ||
| ) |
| OSErr Eject | ( | ConstStr63Param | volName, |
| short | vRefNum | ||
| ) |
| void FInitQueue | ( | void | ) |
Clear enqueued File Manager calls.
FInitQueue purges the File Manager queue of all I/O requests, except for the current one (if any).
none
FInitQueue is useful when several asynchronous calls are queued and an error occurs on one of the early calls. Use it to ditch the subsequent calls to avoid having to handle the errors that are sure to occur.
| OSErr flushvol | ( | const char * | volName, |
| short | vRefNum | ||
| ) |
| OSErr FlushVol | ( | ConstStr63Param | volName, |
| short | vRefNum | ||
| ) |
| OSStatus FNGetDirectoryForSubscription | ( | FNSubscriptionRef | subscription, |
| FSRef * | ref | ||
| ) |
FNGetDirectoryForSubscription()
Summary: Fetch the directory for which this subscription was originally entered. There is no path variant because paths are fragile, and the path may have changed. If the caller does not care about this subtlety, she can call FSRefMakePath to get a path from the returned ref.
Parameters:
subscription: Subscription previously returned from FNSubscribe or FNSubscribeForPath
ref: Directory for which this subscription was created
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
Summary: Broadcasts notification of changes to the specified directory.
Parameters:
ref: The directory for which to broadcast the notification
message: An indication of what happened to the target directory
flags: Options about delivery of the notification (specify kNilOptions for default behaviour)
| OSStatus FNNotifyAll | ( | FNMessage | message, |
| OptionBits | flags | ||
| ) |
Discussion: Broadcasts notification of changes to the filesystem (should only be used by installers or programs which make lots of changes and only send one broadcast).
Parameters:
message: An indication of what happened
flags: Options about delivery of the notification (specify kNilOptions for default behaviour)
| OSStatus FNNotifyByPath | ( | const UInt8 * | path, |
| FNMessage | message, | ||
| OptionBits | flags | ||
| ) |
Summary: Broadcasts notification of changes to the specified directory.
Parameters:
path: Path to the directory for which to broadcast the notification
message: An indication of what happened to the target directory
flags: Options about delivery of the notification (specify kNilOptions for default behaviour)
| OSStatus FNSubscribe | ( | const FSRef * | directoryRef, |
| FNSubscriptionUPP | callback, | ||
| void * | refcon, | ||
| OptionBits | flags, | ||
| FNSubscriptionRef * | subscription | ||
| ) |
Summary: Subscribe to change notifications for the specified directory.
Parameters:
directoryRef: Directory for which the caller wants notifications
callback: Function to call back when a notification arrives
refcon: User state carried with the subscription
flags: Options for future use (specify kNilOptions, or one of the FNSubscriptionOptions)
subscription: Subscription token for subsequent query or unsubscription
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| OSStatus FNSubscribeByPath | ( | const UInt8 * | directoryPath, |
| FNSubscriptionUPP | callback, | ||
| void * | refcon, | ||
| OptionBits | flags, | ||
| FNSubscriptionRef * | subscription | ||
| ) |
Summary: Subscribe to change notifications for the specified directory.
Parameters:
directoryPath: Directory for which the caller wants notifications
callback: Function to call back when a notification arrives
refcon: User state carried with the subscription
flags: Options for future use (specify kNilOptions, or one of the FNSubscriptionOptions)
subscription: Subscription token for subsequent query or unsubscription
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| OSStatus FNUnsubscribe | ( | FNSubscriptionRef | subscription | ) |
Summary: Release a subscription which is no longer needed.
Parameters:
subscription: Subscription previously returned from FNSubscribe or FNSubscribeForPath
@par Non-Carbon CFM: not available @par Carbon Lib: not available in CarbonLib 1.x, is available on Mac OS
X version 10.1 and later
| OSErr FSAllocateFork | ( | SInt16 | forkRefNum, |
| FSAllocationFlags | flags, | ||
| UInt16 | positionMode, | ||
| SInt64 | positionOffset, | ||
| UInt64 | requestCount, | ||
| UInt64 * | actualCount | ||
| ) |
AllocateFork Allocate space to an open fork. Typically, the space to be allocated is beyond the current size of the fork, to reserve space so the file will be able to grow later. Some volume formats are unable to allocate space beyond the logical size of the fork. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork -> positionMode The base location for start of allocation -> positionOffset The offset of the start of allocation -> allocationFlags Zero or more of the following flags: kFSAllocContiguousMask Any newly allocated space must be one contiguous piece. kFSAllocAllOrNothingMask All of the request space must be available, or the call will fail. (If not set, the call may succeed even though some of the requested space wasn't allocated.) kFSAllocNoRoundUpMask Do not allocate additional space. (If not set, a volume may allocate additional space in order to reduce fragmentation.) <> allocationAmount The number of bytes to allocate On output, the number of bytes actually added FSAllocateFork()
| OSErr FSCatalogSearch | ( | FSIterator | iterator, |
| const FSSearchParams * | searchCriteria, | ||
| ItemCount | maximumObjects, | ||
| ItemCount * | actualObjects, | ||
| Boolean * | containerChanged, | ||
| FSCatalogInfoBitmap | whichInfo, | ||
| FSCatalogInfo * | catalogInfos, | ||
| FSRef * | refs, | ||
| FSSpec * | specs, | ||
| HFSUniStr255 * | names | ||
| ) |
CatalogSearch Iterates over catalog objects, searching for objects that match given search criteria. Returns various information about matching objects. For now, iterator must have been created with kFSIterateSubtree option and the container must have been the root directory of a volume. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> iterator The iterator -> maximumItems The maximum number of items to return <- actualItems The actual number of items returned <- containerChanged Set to true if the container's contents changed -> whichInfo The catalog information fields to return for each item <- catalogInfo An array of catalog information; one for each returned item <- refs An array of FSRefs; one for each returned item <- specs An array of FSSpecs; one for each returned item <- names An array of filenames; one for each returned item -> searchParams The criteria that controls the matching, including timeout, a bitmap controlling the fields to compare, and the (Unicode) name to compare. Note: The catalogInfo, refs, specs, and names are all optional outputs; if you don't want that particular output, set its pointer to NULL. FSCatalogSearch()
| OSErr FSClose | ( | short | refNum | ) |
Close a file.
FSClose removes the access path of an open file and updates the directory entry for the file. The file must be re-opened before attempting any subsequent file I/O calls. fRefNum is the reference number of an open file. See FSOpen and OpenRF .
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnfErr(-43) File not found fnOpnErr (-38) File not open ioErr(-36) I/O error nsvErr (-35) No such volume rfNumErr (-51) Bad fRefNum
DO NOT close a file that has already been closed. As incredible as it sounds, it is possible to wipe out a disk if you do so. A safe suggestion is to set your file reference number to 0 (an invalid value) after you close a file; then if you close the file again, you'll get an error, rather than a catastrophe. FSClose (or even PBClose ) does not guarantee that the file (or even the directory) on disk has been updated with any recent writes. You must use FlushVol or PBFlushFile to ensure that data gets physically written to disk. Otherwise, a power outage or the chance of a system error will cause work to be lost.
| OSErr FSCloseFork | ( | SInt16 | forkRefNum | ) |
CloseFork Flush and close a fork. Any data written to this fork refnum is flushed to the device. The volume's control structures are also flushed to the device. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork to close FSCloseFork()
| OSErr FSCloseIterator | ( | FSIterator | iterator | ) |
CloseIterator Invalidates and disposes an FSIterator. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> iterator The returned FSIterator FSCloseIterator()
CompareFSRefs Test whether two FSRefs refer to the same file or directory. If they do, noErr is returned. Otherwise, an appropriate error (such as errFSRefsDifferent) is returned. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref A pointer to the first FSRef -> parentRef A pointer to the second FSRef FSCompareFSRefs()
| OSErr FSCreateDirectoryUnicode | ( | const FSRef * | parentRef, |
| UniCharCount | nameLength, | ||
| const UniChar * | name, | ||
| FSCatalogInfoBitmap | whichInfo, | ||
| const FSCatalogInfo * | catalogInfo, | ||
| FSRef * | newRef, | ||
| FSSpec * | newSpec, | ||
| UInt32 * | newDirID | ||
| ) |
CreateDirectoryUnicode Creates a new directory. The input directory name is in Unicode. You can optionally set catalog info for the directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The parent directory where the directory is to be created -> whichInfo Which catalog info fields to set -> catInfo The values for catalog info fields to set; may be NULL -> nameLength Number of Unicode characters in the directory's name -> name A pointer to the Unicode name <- ioDirID The DirID of the new directory <- spec A pointer to the FSSpec for the new directory; may be NULL <- newRef A pointer to the FSRef for the new directory; may be NULL FSCreateDirectoryUnicode()
| OSErr FSCreateFileUnicode | ( | const FSRef * | parentRef, |
| UniCharCount | nameLength, | ||
| const UniChar * | name, | ||
| FSCatalogInfoBitmap | whichInfo, | ||
| const FSCatalogInfo * | catalogInfo, | ||
| FSRef * | newRef, | ||
| FSSpec * | newSpec | ||
| ) |
CreateFileUnicode Creates a new file. The input filename is in Unicode. You can optionally set catalog info for the file. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The directory where the file is to be created -> whichInfo Which catalog info fields to set -> catInfo The values for catalog info fields to set; may be NULL -> nameLength Number of Unicode characters in the file's name -> name A pointer to the Unicode name <- spec A pointer to the FSSpec for the new directory; may be NULL <- newRef A pointer to the FSRef for the new file; may be NULL FSCreateFileUnicode()
| OSErr FSCreateFork | ( | const FSRef * | ref, |
| UniCharCount | forkNameLength, | ||
| const UniChar * | forkName | ||
| ) |
CreateFork Create a named fork for a file or directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory -> forkNameLength The length of the fork name (in Unicode characters) -> forkName The name of the fork to open (in Unicode) FSCreateFork()
| OSErr fsdelete | ( | const char * | fileName, |
| short | vRefNum | ||
| ) |
| OSErr FSDeleteFork | ( | const FSRef * | ref, |
| UniCharCount | forkNameLength, | ||
| const UniChar * | forkName | ||
| ) |
DeleteFork Delete a named fork of a file or directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory -> forkNameLength The length of the fork name (in Unicode characters) -> forkName The name of the fork to open (in Unicode) FSDeleteFork()
| OSErr FSDeleteObject | ( | const FSRef * | ref | ) |
DeleteObject Deletes an existing file or directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory to be deleted FSDeleteObject()
ExchangeObjects swap the contents of two files. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The first file -> parentRef The second file FSExchangeObjects()
| OSErr FSFlushFork | ( | SInt16 | forkRefNum | ) |
FlushFork Flush a fork. Any data written to this fork refnum is flushed to the device. The volume's control structures are also flushed to the device. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork to flush FSFlushFork()
| OSErr FSGetCatalogInfo | ( | const FSRef * | ref, |
| FSCatalogInfoBitmap | whichInfo, | ||
| FSCatalogInfo * | catalogInfo, | ||
| HFSUniStr255 * | outName, | ||
| FSSpec * | fsSpec, | ||
| FSRef * | parentRef | ||
| ) |
GetCatalogInfo Returns various information about a given file or directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory whose information is to be returned -> whichInfo Which catalog info fields to get <- catInfo The returned values of catalog info fields; may be NULL <- spec A pointer to the FSSpec for the object; may be NULL <- parentRef A pointer to the FSRef for the object's parent directory; may be NULL <- outName The Unicode name is returned here. This pointer may be NULL. Note: All of the outputs are optional; if you don't want that particular output, just set its pointer to NULL. This is the call to use to map from an FSRef to an FSSpec. FSGetCatalogInfo()
| OSErr FSGetCatalogInfoBulk | ( | FSIterator | iterator, |
| ItemCount | maximumObjects, | ||
| ItemCount * | actualObjects, | ||
| Boolean * | containerChanged, | ||
| FSCatalogInfoBitmap | whichInfo, | ||
| FSCatalogInfo * | catalogInfos, | ||
| FSRef * | refs, | ||
| FSSpec * | specs, | ||
| HFSUniStr255 * | names | ||
| ) |
GetCatalogInfoBulk Iterates over catalog objects and returns information about them. For now, iterator must have been created with kFSIterateFlat option. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> iterator The iterator -> maximumItems The maximum number of items to return <- actualItems The actual number of items returned <- containerChanged Set to true if the container's contents changed -> whichInfo The catalog information fields to return for each item <- catalogInfo An array of catalog information; one for each returned item <- refs An array of FSRefs; one for each returned item <- specs An array of FSSpecs; one for each returned item <- names An array of filenames; one for each returned item Note: The catalogInfo, refs, specs, names, and containerChanged are all optional outputs; if you don't want that particular output, set its pointer to NULL. FSGetCatalogInfoBulk()
| OSErr FSGetDataForkName | ( | HFSUniStr255 * | dataForkName | ) |
FSGetDataForkName Returns the constant for the name of the data fork (the empty string) FSGetDataForkName()
| OSErr FSGetForkCBInfo | ( | SInt16 | desiredRefNum, |
| FSVolumeRefNum | volume, | ||
| SInt16 * | iterator, | ||
| SInt16 * | actualRefNum, | ||
| FSForkInfo * | forkInfo, | ||
| FSRef * | ref, | ||
| HFSUniStr255 * | outForkName | ||
| ) |
GetForkCBInfo Return information about an open fork. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function <> desiredRefNum If non-zero on input, then get information for this refnum; unchanged on output. If zero on input, iterate over all open forks (possibly limited to a single volume); on output, contains the fork's refnum. -> volumeRefNum Used when desiredRefNum is zero on input. Set to 0 to iterate over all volumes, or set to a FSVolumeRefNum to limit iteration to that volume. <> iterator Used when desiredRefNum is zero on input. Set to 0 before iterating. Pass the iterator returned by the previous call to continue iterating. <- actualRefNum The refnum of the open fork. <- ref The FSRef for the file or directory that contains the fork. <- forkInfo Various information about the open fork. <- outForkName The name of the fork Note: the foundRefNum, ref, forkInfo, and fork name outputs are all optional; if you don't want a particular output, then set its pointer to NULL. If forkName is NULL, then forkNameLength will be undefined. Note: Returning the forkInfo generally does not require a disk access. Returning the ref or forkName may cause disk access for some volume formats. FSGetForkCBInfo()
| OSErr FSGetForkPosition | ( | SInt16 | forkRefNum, |
| SInt64 * | position | ||
| ) |
GetForkPosition Get the current (default) position of a fork that was opened via OpenFork. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork <- positionOffset The current position of the fork FSGetForkPosition()
| OSErr FSGetForkSize | ( | SInt16 | forkRefNum, |
| SInt64 * | forkSize | ||
| ) |
GetForkSize Get the current logical size (end-of-file) of an open fork. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork <- positionOffset The logical size of the fork, in bytes FSGetForkSize()
| OSErr FSGetResourceForkName | ( | HFSUniStr255 * | resourceForkName | ) |
FSGetResourceForkName Returns the constant for the name of the resource fork (currently "RESOURCE_FORK"). FSGetResourceForkName()
| OSErr FSGetVolumeInfo | ( | FSVolumeRefNum | volume, |
| ItemCount | volumeIndex, | ||
| FSVolumeRefNum * | actualVolume, | ||
| FSVolumeInfoBitmap | whichInfo, | ||
| FSVolumeInfo * | info, | ||
| HFSUniStr255 * | volumeName, | ||
| FSRef * | rootDirectory | ||
| ) |
GetVolumeInfo Returns various information about a given volume, or indexing over all volumes. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function <> ioVRefNum On input, the volume reference number or drive number whose information is to be returned (if volumeIndex is 0); same as "volume" input to FSGetVolumeInfo. On output, the actual volume reference number; same as "actualVolume" output of FSGetVolumeInfo. -> volumeIndex The index of the desired volume, or 0 to use ioVRefNum -> whichInfo Which volInfo info fields to get <- volumeInfo The returned values of Volume info fields; may be NULL <- name The Unicode name is returned here. This pointer may be NULL. Note: All of the outputs are optional; if you don't want that particular output, just set its pointer to NULL. FSGetVolumeInfo()
| OSErr FSIterateForks | ( | const FSRef * | ref, |
| CatPositionRec * | forkIterator, | ||
| HFSUniStr255 * | forkName, | ||
| SInt64 * | forkSize, | ||
| UInt64 * | forkPhysicalSize | ||
| ) |
IterateForks Return the names and sizes of the forks of a file or directory. One fork is returned per call. -> ioCompletion A pointer to a completion routine. <- ioResult The result code of the function. -> ref The file or directory containing the forks. <- positionOffset The length of the fork, in bytes. <- allocationAmount The space allocated to the fork (physical length). <- outForkName The name of the fork in Unicode. <> forkIterator Maintains state between calls for a given FSRef. Before the first call, set the initialize field to zero. FSIterateForks()
| OSErr FSMakeFSRefUnicode | ( | const FSRef * | parentRef, |
| UniCharCount | nameLength, | ||
| const UniChar * | name, | ||
| TextEncoding | textEncodingHint, | ||
| FSRef * | newRef | ||
| ) |
MakeFSRefUnicode Create an FSRef for an existing object specified by Parent FSRef and Unicode name. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref A pointer to the parent directory FSRef -> name A pointer to Unicde name -> nameLength The length of the Unicode Name -> textEncodingHint A suggested text encoding to use for the name <- newRef A pointer to an FSRef FSMakeFSRefUnicode()
| OSErr FSMakeFSSpec | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| FSSpec * | spec | ||
| ) |
Convert a file or directory spec into an FSSpec record.
You use the FSMakeFSSpec function to convert a conventional file or directory specification into an FSSpec record. vRefNum is the volume reference number, a working directory reference number, a drive number, or 0 for the default volume. dirIDis usually the parent directory ID of the target object. If the directory is sufficiently specified by either vRefNum or fileName , dirID can be 0. If you explicitly specify dirID (that is, if it is any value other than 0), and if vRefNum is a working directory reference number, dirID overrides the directory ID included in vRefNum . If the fileName parameter is an empty string, FSMakeFSSpec creates an FSSpec record for a directory specified by either the dirID or vRefNum parameter. fileName is a full or partial pathname. If it is a full pathname, FSMakeFSSpec ignores vRefNum and dirID. A partial pathname might identify only the final target, or it might include one or more parent directory names. If fileName is a partial pathname, vRefNum , dirID , or both must be valid. specis a pointer to an FSSpec record, which FSMakeFSSpec fills in Returns: an operating system Error Code . It will be one of: noErr(0) No error fnfErr(-43) File or directory does not exist ( FSSpec is still valid)
FSMakeFSSpec places the specification in the spec parameter. Call FSMakeFSSpec whenever you want to create an FSSpec record. You can pass the input to FSMakeFSSpec in any of the four ways described in File Specification Strategies under the section entitled Identifying Files, Directories, and Volumes . See the table in Using FSSpec Records under Using the File Manager for details of how FSMakeFSSpec interprets input. If the specified volume is mounted and the specified parent directory exists, but the target file or directory doesn't exist in that location, FSMakeFSSpec fills in the record and then returns fnfErr instead of noErr. The record is valid, but it describes a target that doesn't exist. You can use the record for other operations, such as creating a file with the FSpCreate function.
MoveObject Move an existing file or directory into a different directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory to be moved -> parentRef The file or directory will be moved into this directory <- newRef A new FSRef for the file or directory in its new location; optional, may be NULL NOTE: Moving an object may change its FSRef. If you want to continue to refer to the object, you should pass a non-NULL pointer in newRef and use that returned FSRef to access the object after the move. The FSRef passed in "ref" may or may not be usable to access the object after it is moved. "newRef" may point to the same storage as "parentRef" or "ref". FSMoveObject()
| OSErr fsopen | ( | const char * | fileName, |
| short | vRefNum, | ||
| short * | refNum | ||
| ) |
| OSErr FSOpen | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| short * | refNum | ||
| ) |
Open the data fork of an existing file.
FSOpen opens the data fork of an existing file for read/write or read-only access (depending upon whether or not the file is locked). fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be opened. It may be a partial or full pathname, depending upon the value of vRefNum . If it is a fully-qualified pathname, vRefNum is ignored. vRefNum is the reference number of the volume or directory containing fileName . It may be one of: volume ref num A "hard" volume number; i.e., the refNum of the root directory on the volume. In this case, fileName must specify the rest of the name, including all subdirectories leading from the root to the file. directory ref num A directory reference number as returned by PBOpenWD and SFPutFile (et.al.) . In this case, fileName can be a simple one-name file in that directory, or a multiple-name pathname including directories leading from vRefNum to the file. 0This specifies the current default volume/directory, as set via SetVol or PBHSetVol . In this case, fileName can be a full or partial pathname as above. fRefNum is the address of a 16-bit short. Upon return, it will contain the file reference number (also called the access path number) of the file. This value is used in all subsequent operations on the open file.
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume ioErr(-36) I/O error bdNamErr (-37) Bad name tmfoErr (-42) Too many files open fnfErr(-43) File not found opWrErr (-49) File already open for writing extFSErr (-58) External file system
The file must exist (use Create to create a new file). If fileName is not found in the volume/directory specified, then the File Manager searches the directory containing the currently-open System File (its volume number is in the global variable BootDrive at 0x0210). If the file is not there, then the File Manager searches the System Folder (actually, it searches the directory whose "hard" ID is in the first long word in the ioVFndrInfo field of the HVolumeParam structure returned by a call to PBHGetVInfo ).
| OSErr FSOpenFork | ( | const FSRef * | ref, |
| UniCharCount | forkNameLength, | ||
| const UniChar * | forkName, | ||
| SInt8 | permissions, | ||
| SInt16 * | forkRefNum | ||
| ) |
OpenFork Open a fork for reading and/or writing. Allows the opened fork to grow beyond 2GB in size. All volumes should support data and resource forks. Other named forks may be supported by some volumes. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory containing the fork to open -> forkNameLength The length of the fork name (in Unicode characters) -> forkName The name of the fork to open (in Unicode) -> permissions The access (read and/or write) you want <- forkRefNum The reference number for accessing the open fork FSOpenFork()
| OSErr FSOpenIterator | ( | const FSRef * | container, |
| FSIteratorFlags | iteratorFlags, | ||
| FSIterator * | iterator | ||
| ) |
OpenIterator Creates an FSIterator to iterate over a directory or subtree. The iterator can then be passed to GetCatalogInfoBulk or CatalogSearch. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function <- iterator The returned FSIterator -> iteratorFlags Controls whether the iterator iterates over subtrees or just the immediate children of the container. -> container An FSRef for the directory to iterate (or root of the subtree to iterate). FSOpenIterator()
Summary: Converts a pathname to an FSRef.
Parameters:
path: A pointer to a C String that is the pathname. The format of the pathname you must supply can be determined with the Gestalt selector gestaltFSAttr's gestaltFSUsesPOSIXPathsForConversion bit. If the gestaltFSUsesPOSIXPathsForConversion bit is clear, the pathname must be a Mac OS File Manager full pathname in a C string. If the gestaltFSUsesPOSIXPathsForConversion bit is set, the pathname must be a UTF8 encoded POSIX absolute pathname in a C string. In either case, the pathname returned by FSRefMakePath can be passed to FSPathMakeRef.
ref: A pointer to an FSRef to fill in.
isDirectory: An optional pointer to a Boolean that will be filled in to indicate if the specified path is a directory (vs. a file).
| OSErr FSpCatMove | ( | const FSSpec * | source, |
| const FSSpec * | dest | ||
| ) |
Change a file's location.
FSpCatMove function changes the location of a file or directory. source is a pointer to an FSSpec record specifying the file to be moved. dest is a pointer to an FSSpec record specifying the file's new location.
an operating system Error Code . It will be one of: noErr(0) No error badMovErr (-122) Can't move into offspring bdNamErr (-37) Bad file name or attempt to move into file dupFNErr (-48) Duplicate filename (destination file/dir already exists) fnfErr(-43) Source file not found ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) Error in user parameter list vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpCatMove is the high-level, FSSpec version of the PBCatMove function. It moves the file or directory specified by the source parameter to the destination specified by the dest parameter. The source and dest parameters specify the name and location of the file or directory before and after the move.
| OSErr FSpCreate | ( | const FSSpec * | spec, |
| OSType | creator, | ||
| OSType | fileType, | ||
| ScriptCode | scriptTag | ||
| ) |
Create a new file and set the type and creator.
FSpCreate creates a new file and sets the type and creator. It is the high-level, FSSpec version of the PBHCreate function. spec is a ponter to an FSSpec record specifying the file to be created creatoris used to set the new file creator fileType is used to set the new file type scriptTag specifies the code of the script system in which the document name is to be displayed. If StandardPutFile was used to get the file, the sfScript field of the StandardFileReply structure should be passed in this parameter. Returns: an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dirNFErr (-120) Directory not found dupFNErr (-48) Duplicate filename already exists extFSErr (-58) External file system ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
If you have established the name and location of the new file through either the StandardPutFile or CustomPutFile procedure, specify the script code returned in the reply record. Otherwise, specify the system script by setting the scriptTag parameter to smSystemScript. For more information on script systems, see the Worldwide Software Overview
| OSErr FSpDelete | ( | const FSSpec * | spec | ) |
Remove a closed file.
FSpDelete removes a closed file. spec is a pointer to an FSSpec record specifying the file to be removed. Returns: an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirNFErr (-120) Directory not found or incomplete pathname extFSErr (-58) External file system fBsyErr (-47) File is busy, directory not empty, or working dir open fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpDelete function removes a closed file. It is the high-level, FSSpec version of the PBHDelete function.
| OSErr FSpDirCreate | ( | const FSSpec * | spec, |
| ScriptCode | scriptTag, | ||
| long * | createdDirID | ||
| ) |
Create a new directory.
FSpDirCreate creates a new empty directory. spec is a pointer to an FSSpec record identifying the new directory scriptTag identifies the script system code createDirID ;on return, will identify the new directory Returns: an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dirNFErr (-120) Directory not found dupFNErr (-48) Duplicate filename (rename) extFSErr (-58) External file system ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpDirCreate function creates a new directory. It is a high-level, FSSpec version of PBDirCreate .
| OSErr FSpExchangeFiles | ( | const FSSpec * | source, |
| const FSSpec * | dest | ||
| ) |
FSpExchangeFiles Swap the files' data.
FSpExchangeFiles swaps the files' data by changing the information in the volume's catalog and, if the files are open, in the file control blocks. source is a pointer to an FSSpec record specifying the source file. destis a pointer to an FSSpec specifying the file that will receive the new data
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) Volume not found ioErr(-36) I/O error fnfErr(-43) File not found fLckdErr (-45) File locked volOffLinErr (-53) Volume is off line extFSErr (-58) External file system wrgVolTypErr (-123) Not an HFS volume notAFileErr (-1302) Specified file is a directory diffVolErr (-1303) Files on different volumes
The Tables in Updating Files under the section, Using the File Manager , illustrate how FSpExchangeFiles alters the catalog entries and file control blocks. You should use FSpExchangeFiles when updating an existing file, so that if the file is being tracked through its file ID, the ID remains valid. Typically, you use PBExchangeFiles after creating a new file during a safe save (see Updating Files under the section, Using the File Manager ,). You identify the two files to be exchanged in the source and dest parameters. FSpExchangeFiles changes the fields in the catalog entries that record the location of the data and the modification dates. It swaps both the data forks and the resource forks. FSpExchangeFiles works on either open or closed files. If either file is open, FSpExchangeFiles updates any file control blocks associated with the file. Exchanging the contents of two files requires essentially the same access as opening both files for writing. FSpExchangeFiles does not require that file IDs exist for the files being exchanged.
| OSErr FSpGetFInfo | ( | const FSSpec * | spec, |
| FInfo * | fndrInfo | ||
| ) |
Get Finder information.
The FSpGetFInfo function returns the Finder information from the volume catalog entry for the specified file or directory. It provides only the original Finder information-the FInfo and DInfo records, not FXInfo and DXInfo spec is a pointer to an FSSpec record specifying the file to be opened fndrInfo identifies the the original Finder information-the FInfo and DInfo records Returns: an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirNFErr (-120) Directory not found extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) Error in user parameter list
The FSpGetFInfo function is the high-level, FSSpec version of the PBHGetFInfo function.
| OSErr FSpMakeFSRef | ( | const FSSpec * | source, |
| FSRef * | newRef | ||
| ) |
MakeFSRef Create an FSRef for an existing object specified by a combination of volume refnum, parent directory, and pathname. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ioNamePtr A pointer to a pathname -> ioVRefNum A volume specification -> ioDirID A directory ID <- newRef A pointer to an FSRef FSpMakeFSRef()
| OSErr FSpOpenDF | ( | const FSSpec * | spec, |
| SInt8 | permission, | ||
| short * | refNum | ||
| ) |
| OSErr FSpOpenRF | ( | const FSSpec * | spec, |
| SInt8 | permission, | ||
| short * | refNum | ||
| ) |
| OSErr FSpRename | ( | const FSSpec * | spec, |
| ConstStr255Param | newName | ||
| ) |
Change a file's name.
FSpRename function changes the name of a file or directory. spec is pointer to aa FSSpec record specifying the file to be renamed. newname is the name you want the file to have. Returns: an operating system Error Code. It will be one of: noErr(0) No error bdNamErr (-37) Bad file or volume name dirFulErr (-33) Directory full dupFNErr (-48) Duplicate filename (new name already exists) extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found fsRnErr (-59) File system rename error ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) Error in user parameter list vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpRename function unlocks a file. It is the high-level, FSSpec version of the PBHRename function.
| OSErr FSpRstFLock | ( | const FSSpec * | spec | ) |
Unlock a file.
FSpRstFLock unlocks a file. spec is pointer to an FSSpec record specifying the file to be unlocked. Returns: an operating system Error Code. It will be one of: noErr(0) No error dirNFErr (-120) Directory not found extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpRstFLock function unlocks a file. It is the high-level, FSSpec version of the PBHRstFLock function.
| OSErr FSpSetFInfo | ( | const FSSpec * | spec, |
| const FInfo * | fndrInfo | ||
| ) |
Set the Finder information.
The FSpSetFInfo function sets the Finder information in the volume catalog entry for the specified file or directory. It affects only the original Finder information-the FInfo and DInfo records, not FXInfo and DXInfo. spec is a pointer to an FSSpec record specifying the file to be opened fndrInfo identifies the the original Finder information-the FInfo and DInfo records Returns: an operating system Error Code. It will be one of: noErr(0) No error dirNFErr (-120) Directory not found extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpSetFInfo functions the high-level, FSSpec version of the PBHSetFInfo function.
| OSErr FSpSetFLock | ( | const FSSpec * | spec | ) |
Lock a file.
FSpSetFLock locks a file. spec is pointer to an FSSpec record specifying the file to be locked. Returns: an operating system Error Code. It will be one of: noErr(0) No error dirNFErr (-120) Directory not found extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FSpSetFLock function locks a file. It is the high-level, FSSpec version of the PBHSetFLock function.
| OSErr FSRead | ( | short | refNum, |
| long * | count, | ||
| void * | buffPtr | ||
| ) |
Read from an open file or device driver.
FSRead is used to read from files and from device drivers. The following description pertains to reading from files, but the two uses are conceptually similar. A description of how to use it with device drivers is also given below. #include < Files.h> File Manager OSErr FSRead(fRefNum , inOutCount , buffer ); short fRefNum ;reference number as obtained from FSOpen long *inOutCount ;bytes to read; receives actual bytes read Ptr buffer ; address of buffer to receive data returns Error Code ; 0=no error FSRead reads data from an open file into the caller's buffer. The read begins at the current position of the file mark and advances that mark by the actual number of bytes read. fRefNum is the reference number of an open file. See FSOpen and OpenRF . inOutCount is the address of a positive long integer. On entry, it specifies the number of bytes you wish to read. Upon return, it will contain the actual number of bytes read. bufferis the address of a memory area, at least inOutCount bytes long. Upon return, the buffer will contain data read from the file.
an operating system Error Code . It will be one of: noErr(0) No error eofErr (-39) End of file (partial read occurred) extFSErr (-58) External file system fnOpnErr (-38) File not open ioErr(-36) I/O error paramErr (-50) inOutCount was negative rfNumErr (-51) Bad file reference number
You can call FSRead repeatedly to read the file sequentially, or you can use SetFPos before the read to access any part of the file randomly. In the event that the end-of-file is reached during the read, the return code will be eofErr and inOutCount value will contain the actual number of bytes read (probably less than the amount requested on entry). Note: This is different from other operating systems that return an EOF error only when attempting to start the read at the EOF. Use the low-level PBRead function for asynchronous reading or to use the 'newline' mode (to read from the current file position up to a carriage
| OSErr FSReadFork | ( | SInt16 | forkRefNum, |
| UInt16 | positionMode, | ||
| SInt64 | positionOffset, | ||
| ByteCount | requestCount, | ||
| void * | buffer, | ||
| ByteCount * | actualCount | ||
| ) |
ReadFork Read data from a fork opened via OpenFork. The first byte to read is indicated by a combination of positionMode and positionOffset. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork to read from <- buffer Pointer to buffer where data will be returned -> requestCount The number of bytes to read <- actualCount The number of bytes actually read -> positionMode The base location for start of read -> positionOffset The offset from base location for start of read FSReadFork()
| OSStatus FSRefMakePath | ( | const FSRef * | ref, |
| UInt8 * | path, | ||
| UInt32 | maxPathSize | ||
| ) |
Summary: Converts an FSRef to a pathname.
Parameters:
ref: An FSRef to the file or directory to get the pathname for.
path: A pointer to a buffer which FSRefMakePath will fill with a C string representing the pathname to the file or directory specified by the ref parameter. The format of the pathname returned can be determined with the Gestalt selector gestaltFSAttr's gestaltFSUsesPOSIXPathsForConversion bit. If the gestaltFSUsesPOSIXPathsForConversion bit is clear, the pathname is a Mac OS File Manager full pathname in a C string, and file or directory names in the pathname may be mangled as returned by the File Manager. If the gestaltFSUsesPOSIXPathsForConversion bit is set, the pathname is a UTF8 encoded POSIX absolute pathname in a C string. In either case, the pathname returned can be passed back to FSRefMakePath to create an FSRef to the file or directory.
maxPathSize: The size of the path buffer in bytes. If the path buffer is too small for the pathname string, FSRefMakePath returns pathTooLongErr or buffersTooSmall.
| OSErr fsrename | ( | const char * | oldName, |
| short | vRefNum, | ||
| const char * | newName | ||
| ) |
| OSErr FSRenameUnicode | ( | const FSRef * | ref, |
| UniCharCount | nameLength, | ||
| const UniChar * | name, | ||
| TextEncoding | textEncodingHint, | ||
| FSRef * | newRef | ||
| ) |
RenameUnicode Change the name of an existing file or directory. The new name is in Unicode. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory to be moved -> nameLength Number of Unicode characters in the new name -> name A pointer to the new Unicode name -> textEncodingHint A suggested text encoding to use for the name <- newRef A new FSRef for the file or directory; may be NULL NOTE: Renaming an object may change its FSRef. If you want to continue to refer to the object, you should pass a non-NULL pointer in newRef and use that returned FSRef to access the object after the rename. The FSRef passed in "ref" may or may not be usable to access the object after it is renamed. "newRef" may point to the same storage as "ref". FSRenameUnicode()
| OSErr FSSetCatalogInfo | ( | const FSRef * | ref, |
| FSCatalogInfoBitmap | whichInfo, | ||
| const FSCatalogInfo * | catalogInfo | ||
| ) |
SetCatalogInfo Set catalog information about a given file or directory. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ref The file or directory whose information is to be changed -> whichInfo Which catalog info fields to set -> catInfo The new values of catalog info fields Note: Only some of the catalog info fields may be set. The settable fields are given by the constant kFSCatInfoSettableInfo; no other bits may be set in whichInfo. FSSetCatalogInfo()
| OSErr FSSetForkPosition | ( | SInt16 | forkRefNum, |
| UInt16 | positionMode, | ||
| SInt64 | positionOffset | ||
| ) |
SetForkPosition Set the current (default) position of a fork that was opened via OpenFork. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork -> positionMode The base location for the new position -> positionOffset The offset of the new position from the base FSSetForkPosition()
| OSErr FSSetForkSize | ( | SInt16 | forkRefNum, |
| UInt16 | positionMode, | ||
| SInt64 | positionOffset | ||
| ) |
SetForkSize Set the logical size (end-of-file) of an open fork. This may cause space to be allocated or deallocated. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork -> positionMode The base location for the new size -> positionOffset The offset of the new size from the base FSSetForkSize()
| OSErr FSSetVolumeInfo | ( | FSVolumeRefNum | volume, |
| FSVolumeInfoBitmap | whichInfo, | ||
| const FSVolumeInfo * | info | ||
| ) |
SetVolumeInfo Set information about a given volume. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> ioVRefNum The volume whose information is to be changed -> whichInfo Which catalog info fields to set -> volumeInfo The new values of volume info fields Note: Only some of the volume info fields may be set. The settable fields are given by the constant kFSVolInfoSettableInfo; no other bits may be set in whichInfo. FSSetVolumeInfo()
| OSErr FSWrite | ( | short | refNum, |
| long * | count, | ||
| const void * | buffPtr | ||
| ) |
Write data from memory to a file.
FSWrite writes data from memory to an open file or an open device driver. Descriptions of both uses of FSWrite are given below When writing to a file, the data is written starting at the current file mark and advances that mark by the actual number of bytes written. fRefNum is the reference number of an open file. See FSOpen and OpenRF . inOutCount is the address of a positive long integer. On entry, it specifies the number of bytes you wish to write. Upon return, it will contain the actual number of bytes written. bufferis the address of a memory area containing the data to be written to disk (it should be at least inOutCount bytes long).
an operating system Error Code . It will be one of: noErr(0) No error dskFulErr (-34) Disk full (incomplete or no write) extFSErr (-58) External file system fLckdErr (-45) File is locked fnOpnErr (-38) File not open ioErr(-36) I/O error paramErr (-50) inOutCount was negative rfNumErr (-51) Bad file reference number wPrErr (-44) Diskette is write-protected wrPermErr (-61) Write permissions doesn't allow writing
You can call FSWrite repeatedly to write the file sequentially, or you can use SetFPos before the write to store data to any part of the file. The file mark is updated (in preparation for the next sequential write). The data is transferred to the volume buffer and may not be written to disk for some time (even after the file is closed). Use FlushVol or PBFlushFile to force buffered data to be written to disk. In the event the disk fills up during the read, the return code will be dskFulErr and inOutCount value will contain the actual number of bytes written (probably less than the amount requested on entry). Use the low-level PBWrite function for asynchronous writing and a possible performance increase. The following example illustrates how to open a file and append a 24-byte data block to the end of the file. See OpenRF for an example that uses FSRead and FSWrite to copy an entire file. See Using FSWrite to Write to a File for a longer example.
| OSErr FSWriteFork | ( | SInt16 | forkRefNum, |
| UInt16 | positionMode, | ||
| SInt64 | positionOffset, | ||
| ByteCount | requestCount, | ||
| const void * | buffer, | ||
| ByteCount * | actualCount | ||
| ) |
WriteFork Write data to a fork opened via OpenFork. The first byte to write is indicated by a combination of positionMode and positionOffset. -> ioCompletion A pointer to a completion routine <- ioResult The result code of the function -> forkRefNum The reference number of the fork to write to -> buffer Pointer to data to write -> requestCount The number of bytes to write <- actualCount The number of bytes actually written -> positionMode The base location for start of write -> positionOffset The offset from base location for start of write FSWriteFork()
| OSErr getfinfo | ( | const char * | fileName, |
| short | vRefNum, | ||
| FInfo * | fndrInfo | ||
| ) |
| OSErr GetFInfo | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| FInfo * | fndrInfo | ||
| ) |
Obtain file type, creator, icon position, etc.
GetFInfo obtains a copy of the 16-byte packet of descriptive information maintained for the Finder. This includes the file's type, the signature of its creator, Finder flags (such as whether the icon is displayed or is actually on the desktop), and the display position of the file's icon within its folder (window). fileName is the address of a length-prefixed, pascal-style string containing the name of the file of interest. It may be a partial or full pathname, depending upon the value of vRefNum . vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . 0 indicates the default volume. fndrInfo is the address of a 16-byte FInfo structure. Upon return, it is filled with file-specific information used by the Finder.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error paramErr (-50) No default volume
The meaning of the bits in the fdFlags field of the FInfo structure has changed since System 6.x. Be sure to check the FInfo structure to be sure that the meaning of the bit that you are checking has not changed. For instance, there is no longer a bit in the fdFlags field which indicates whether or not a file is locked. To determine this information call PBGetFInfo and examine the ioFlAttrib field. GetFInfo is a functional subset of the low-level PBGetFInfo call (which allows you to examine the file's date/time information as well as the Finder-specific data). The FInfo structure maintains the primary information used by the Finder in locating the icon to display, where to display it and which application to run when its icon is double-clicked. It is the same information as in the ioFlFndrInfo field of the FileParam structure, which is passed to custom "file filters" used in the Standard File Package (see SFGetFile ). Additional Finder information is maintained in an FXInfo structure, which can be obtained via PBGetCatInfo . Use SetFInfo , PBSetFInfo , or PBSetCatInfo to modify the Finder information (and other information about a file).
| OSErr GetFPos | ( | short | refNum, |
| long * | filePos | ||
| ) |
Obtain position of the file mark of an open file.
GetFPos returns the current position of the file mark (the file address at which the next read or write will begin). fRefNum is the reference number of an open file. See FSOpen and OpenRF . filePosis the address of a 32-bit long integer. Upon return, it will contain the current value of the file's mark; i.e., an offset in bytes from the start of the file.
an operating system Error Code . It will be one of: noErr(0) No error eofErr (-39) End of file extFSErr (-58) External file system fnOpnErr (-38) File not open ioErr(-36) I/O error rfNumErr (-51) fRefNum is invalid
You can use GetFPos before attempting a read, and compare the return value of filePos to the location of file's logical end-of-file (see GetEOF). See OpenRF for an example usage of this function. The SetFPos function performs the complementary function of setting the file mark, in preparation for reading from or writing to the file at that position.
| QHdrPtr GetFSQHdr | ( | void | ) |
Obtain pointer to the file I/O queue header.
GetFSQHdr returns the address of the standard Operating System queue used to maintain the linked-list of I/O requests.
a 32-bit QHdrPtr; the address of the 10-byte QHdr structure whose qLink field points to the parameter block of the first pending file I/O request.
C programmers may prefer to get the address from the global variable FSQHdr (at 0x0360). Given this queue header pointer, an application could use the OS Utility functions Enqueue and Dequeue to manipulate the queue elements (I/O requests), or it could walk through the queue element chain to count how many requests are pending. The I/O queue is a series of parameter blocks, linked by the qLink field of each block. When using Asynchronous I/O , you may discover that an early request generated an error, invalidating other subsequent requests. In that case, you could use FInitQueue to purge the queue, or you could fiddle with the I/O queue elements directly. Be aware that the File Manager does its own manipulation at interrupt time.
| OSErr getvinfo | ( | short | drvNum, |
| char * | volName, | ||
| short * | vRefNum, | ||
| long * | freeBytes | ||
| ) |
| OSErr getvol | ( | char * | volName, |
| short * | vRefNum | ||
| ) |
| OSErr GetVol | ( | StringPtr | volName, |
| short * | vRefNum | ||
| ) |
Obtain name and reference number of default volume.
GetVol returns the name and volume reference number of the current default volume or working directory. volName is either the address of a 28-byte buffer or NIL (0). Upon return, one of the following will be true: address: The buffer at volName will contain the name of the root directory of the default volume (as a length-prefixed pascal-style string) and vRefNum will contain its volume reference number. NIL (0) The word at vRefNum will contain the correct directory number of the current working directory. Note: This does NOT return multiple-name pathnames. vRefNum is the address of an unsigned short. Upon return it will contain the default volume's reference number (or if a previous call to SetVol used a working directory reference, vRefNum will receive that same value).
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume
Initially, the root of the startup disk is the default volume (or working directory) for an application. After you set the default, you can use NIL for a file name and 0 for a volume reference - this will imply the default volume (or directory). The lower-level PBGetVol returns the same information. Use PBHGetVol to obtain a few snippets of additional data. Use PBHSetVol to select both a default volume and directory. Use PBOpenWD to open a working directory and use SetVol to select the root of a volume (or a previously-opened working directory) as the default. Example #include < Files.h> Str255 volName; shortvRef; shortrc;
| OSErr GetVRefNum | ( | short | fileRefNum, |
| short * | vRefNum | ||
| ) |
Get volume reference number of an open file.
Given the reference number of an open file, GetVRefNum returns the reference number of the volume on which the file resides. fRefNum identifies the file whose volume reference you wish to query. This is normally a value obtained via FSOpen, or SFGetFile , et al. vRefNum is the address of an unsigned short. Upon return it will contain the volume reference number of the volume containing the file identified in fRefNum .
an operating system Error Code . It will be one of: noErr(0) No error rfNumErr (-51) Bad refNum
You can use the low-level PBGetFCBInfo function to obtain additional information about any open file.
| OSErr GetWDInfo | ( | short | wdRefNum, |
| short * | vRefNum, | ||
| long * | dirID, | ||
| long * | procID | ||
| ) |
Query information about an existing working directory.
GetWDInfo obtains the "hard" directory ID and the real volume number associated with a working directory.
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume
| OSErr HCreate | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| OSType | creator, | ||
| OSType | fileType | ||
| ) |
Create a new file like PB and set type and creator.
HCreate creates a new file like PBHCreate , and then sets the file type and
creator of the file.
vRefNum is the reference number of the volume or working directory to
contain fileName . See FSOpen for a description of the options.
dirIDis the directory ID of the directory to contain fileName .
fileName is the address of a length-prefixed, pascal-style string containing
the name of the file to be created. It may be a partial or full
pathname, depending upon the value of vRefNum . You should NOT use
names beginning with a period ('.') since that convention is reserved
for devices.
creatoris a 32-bit value, often expressed as a four-letter literal (e.g.,
'MSWD'). It is normally the unique signature of your application
(as registered with Apple), or the signature of the application which
want to be launched when this file is double-clicked in the Finder.
Note: use creator = '????' if you don't want the file to auto-start
any application.
fileType is a 32-bit value, normally expressed as a four-letter literal (e.g.,
'TEXT'). It identifies the file type, which helps applications
determine how to process the file. This value is used in file filtering
(see SFGetFile , et.al).
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dupFNErr (-48) Duplicate filename (rename) extFSErr (-58) External file system ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
Use SetFInfo for control over other descriptive information about the file, such as the Finder's placement of the file's icon in its folder, whether or not the file has a bundle of descriptive resources, and whether the file's icon is invisible.
| OSErr HDelete | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName | ||
| ) |
Delete an unopened file or empty directory.
HDelete deletes both forks of a file. The file must not be open. This function can also be used to delete an empty directory. vRefNum is the reference number of the volume or working directory containing the file or directory fileName . Use 0 to specify the default volume. dirIDis the ID of the directory that contains the file to be deleted. fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be deleted. It may be a partial or full pathname, depending upon the value of vRefNum .
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name extFSErr (-58) External file system fBsyErr (-47) File is busy fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
If the file to delete is currently open (or if the directory to delete contains any files or directories) HDelete will fail, returning an Error Code . Use PBDelete if you need to specify a file version number. If you want to clear out an entire directory, use PBGetCatInfo to index through all entries in the directory. Note that this is a permanent deletion, and not a retrievable transfer to a friendly "trash can ”. However, a good disk utility package can recover the file data as long as no new data is written over it.
| OSErr HGetFInfo | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| FInfo * | fndrInfo | ||
| ) |
Obtain file type, creator, icon position, etc.
HGetFInfo obtains a copy of the 16-byte packet of descriptive information maintained for the Finder. This includes the file's type, the signature of its creator, Finder flags (such as whether the icon is displayed or is actually on the desktop), and the display position of the file's icon within its folder (window). vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . 0 indicates the default volume. dirIDis the directory ID that contains the file to get info about fileName is the address of a length-prefixed, pascal-style string containing the name of the file of interest. It may be a partial or full pathname, depending upon the value of vRefNum . fndrInfo is the address of a 16-byte FInfo structure. Upon return, it is filled with file-specific information used by the Finder.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error paramErr (-50) No default volume
The FInfo structure maintains the primary information used by the Finder in locating the icon to display, where to display it and which application to run when its icon is double-clicked. It is the same information as in the ioFlFndrInfo field of the FileParam structure, which is passed to custom "file filters" used in the Standard File Package (see SFGetFile ). Additional Finder information is maintained in an FXInfo structure, which can be obtained via PBGetCatInfo . Use SetFInfo , PBSetFInfo , or PBSetCatInfo to modify the Finder information (and other information about a file). If your application rewrites files by deleting the original and creating a new one, you should maintain the position on the file's icon within its folder.
| OSErr HGetVol | ( | StringPtr | volName, |
| short * | vRefNum, | ||
| long * | dirID | ||
| ) |
Obtain default volume/directory name and reference.
Use HGetVol to get the vRefNum and dirID of the current default volume or directory. It is similar to PBGetVol , except it uses refNums and dirID's instead of a ParmBlkPtr .
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume paramErr (-50) No default volume
The ioNamePtr field can be NIL to ignore the name. Otherwise, it should point to a 28-byte buffer to hold the maximum 27-character name of the default volume. Note that this does NOT return a multiple-name directory name, even when a previous SetVol set the default to a working directory.
| OSErr HOpen | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| SInt8 | permission, | ||
| short * | refNum | ||
| ) |
| OSErr HOpenDF | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| SInt8 | permission, | ||
| short * | refNum | ||
| ) |
| OSErr HOpenRF | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| SInt8 | permission, | ||
| short * | refNum | ||
| ) |
| OSErr HRename | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | oldName, | ||
| ConstStr255Param | newName | ||
| ) |
Rename a file, volume, or directory.
HRename changes the name of a file or volume. It does NOT move a file from one directory to another (use PBCatMove for that). It is similar to yet easier to use than PBReName since it uses a vRefNum and dirID instead of a ParmBlkRec structure.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name dirFulErr (-33) Directory full dupFNErr (-48) Duplicate filename (new name already exists) extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found fsRnErr (-59) File system rename error ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) No default volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
| OSErr HRstFLock | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName | ||
| ) |
Unlock a file (allow changes, deletion, renaming, etc.)
HRstFLock unlocks a file; it undoes the effect of SetFLock . This allows programs to delete, rename, or write data to it. vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . Use 0 to specify the default volume. dirIDis the directory ID of the directory where the file resides. fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be unlocked. It may be a partial or full pathname, depending upon the value of vRefNum .
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
This clears the file's "lock" flag (as found in the ioFlAttrib field of the FileParam structure) and notifies the system of the change (Note: changing this bit directly, e.g., via PBSetCatInfo , may not be noticed by the Finder until the file's folder is closed and reopened or the system is restarted). This does not affect currently-open access paths. Thus, if some other process has opened the file, locking it will not prevent the other program from continuing to modify it. See SetFLock for related details. You can lock/unlock an entire volume via PBSetVInfo or lock a selected portion of an open file via PBLockRange . Use PBGetFInfo to see if a file is currently locked (ioFlAttrib bit 1 is set).
| OSErr HSetFInfo | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName, | ||
| const FInfo * | fndrInfo | ||
| ) |
Change file type, creator, icon position, etc.
HSetFInfo changes Finder-specific information about a file. This includes the file's type, the signature of its creator, Finder flags (such as whether the icon is displayed), and the display position of the file's icon within its window. vRefNum is the reference number of the volume or working directory containing the file or directory fileName . 0 indicates the default volume. dirIDis the ID of the directory that contains the file to set info about fileName is the address of a length-prefixed, pascal-style string containing the name of the target file. It may be a partial or full pathname, depending upon the value of vRefNum . fndrInfo is the address of a 16-byte FInfo structure containing the desired values of Finder specific information to be changed. Normal usage is to pre-set all fields with current values by first calling GetFInfo , then change only those fields you wish to modify.
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The FInfo structure maintains the primary information used by the Finder in locating the icon to display, where to display it, and which application to run when its icon is double-clicked. It is the same information as in the ioFlFndrInfo field of the FileParam structure, which is passed to the custom "file filters" used in the Standard File Package (see SFGetFile ). Additional Finder information is maintained in an FXInfo structure, which can be obtained via PBGetCatInfo . In all operations where you modify file-descriptive information, the normal usage is to obtain a copy of the current information before modifying selected fields and updating the disk.
| OSErr HSetFLock | ( | short | vRefNum, |
| long | dirID, | ||
| ConstStr255Param | fileName | ||
| ) |
Lock a file (prevent changes, deletion, renaming, etc.)
HSetFLock locks a file. This prevents programs from modifying it in any way - deleting, renaming, or writing to either its data or resource fork. It is similar to SetFLock except that it takes a vRefNum/dirID combination instead of just a vRefNum. vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . Use 0 to specify the default volume. dirIDis the ID of the directory where the file resides. fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be locked. It may be a partial or full pathname, depending upon the value of vRefNum .
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
This sets the file's "lock" flag (as found in the ioFlAttrib field of the FileParam structure) and notifies the system of the change (Note: if you change this bit directly, as with PBSetCatInfo , the change may not be noticed by the Finder until the file's folder is closed and reopened or the system is restarted). This prevents programs from deleting ( FSDelete ), renaming ( Rename ), or writing ( FSWrite ) to the file. Any attempt to open the file ( FSOpen) for read/write access will fail. Of course, any process can unlock the file (via RstFLock ) if it wants such access. This has no affect on currently-open access paths. Thus, you can open a file for writing, then lock it to prevent other concurrent processes from writing to it. Afterward, use RstFLock to unlock the file. You can lock/unlock an entire volume via PBSetVInfo or lock a selected portion of an open file via PBLockRange . Use PBGetFInfo to see if a file is currently locked (ioFlAttrib bit 1 is set). Be sure to call FlushVol to make sure that the change is written to the disk in a timely manner.
| OSErr HSetVol | ( | ConstStr63Param | volName, |
| short | vRefNum, | ||
| long | dirID | ||
| ) |
Select a default default volume/directory (HFS only)
Apple does not recommend using HSetVol or PBSetVol . See the notes below for details. HSetVol is used to select a default volume. The File Manager will use these defaults in future calls in which you specify no volume name and a volume reference number of 0.
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No default volume
You can specify the new default by any of the following options: •A full or partial pathname (ends in a colon). Put the address of the pascal-style string in ioNamePtr. •A volume number or a working directory number in ioVRefNum If you use a WD ref, it will affect how PBGetVol works. •A directory number in ioWDDirID (as obtained via PBOpenWD ). See SetVol for an example showing usage of various ways to set a default volume and open a file. HSetVol lets you specify a WDRefNum for the ioVRefNum in addition to a paritial pathname in ioNamePtr. HSetVol will start at the specified working directory and use the paritial pathname to determine the final directory. This directory might not correspond to an already existing working directory, so the File Manager cannot refer to this directory with a WDRefNum. Instead it must use the actual volume refNum and the dirID number (which is assigned when the directory is created, and does not change). This all means that if you call HSetVol , the File Manager stores the actual volume refNum as the default volume, and the default dirID separately. This will happen on all calls to HSetVol . Subsequent calls to GetVol or PBGetVol or HGetVol will return only the volume refNum in the ioVRefNum field of the parameter block. If any code tries to use the refNum returned by GetVol or HGetVol , it will be accessing the root of the volume, and not the current default directory as expected. This can be disastrous for desk accessories because they don't know that your code has called HSetVol or PBGetVol and they don't get what they expect if they call GetVol. Because of these problems, Apple does not recommend using HSetVol or PBSetVol .
| if | ( | rc | ) |
Delete an unopened file or empty directory.
FSDelete deletes both forks of a file. The file must not be open. This function can also be used to delete an empty directory. fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be deleted. It may be a partial or full pathname, depending upon the value of vRefNum . vRefNum is the reference number of the volume or working directory containing the file or directory fileName . Use 0 to specify the default volume.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name extFSErr (-58) External file system fBsyErr (-47) File is busy fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
If the file to delete is currently open (or if the directory to delete contains any files or directories) FSDelete will fail, returning an Error Code . Use PBDelete if you need to specify a file version number. If you want to clear out an entire directory, use PBGetCatInfo to index through all entries in the directory. Note that this is a permanent deletion, and not a retrievable transfer to a friendly "trash can ”. However, a good disk utility package can recover the file data as long as no new data is written over it. Example #include < Files.h> shortrc; rc = FSDelete ( "\pHardDisk:Ltrs:Smith", 0 ); /* delete file
| void InvokeFNSubscriptionUPP | ( | FNMessage | message, |
| OptionBits | flags, | ||
| void * | refcon, | ||
| FNSubscriptionRef | subscription, | ||
| FNSubscriptionUPP | userUPP | ||
| ) |
| void InvokeIOCompletionUPP | ( | ParmBlkPtr | paramBlock, |
| IOCompletionUPP | userUPP | ||
| ) |
| FNSubscriptionUPP NewFNSubscriptionUPP | ( | FNSubscriptionProcPtr | userRoutine | ) |
| IOCompletionUPP NewIOCompletionUPP | ( | IOCompletionProcPtr | userRoutine | ) |
| OSErr OpenDF | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| short * | refNum | ||
| ) |
| OSErr openrf | ( | const char * | fileName, |
| short | vRefNum, | ||
| short * | refNum | ||
| ) |
| OSErr OpenRF | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| short * | refNum | ||
| ) |
| OSErr OpenWD | ( | short | vRefNum, |
| long | dirID, | ||
| long | procID, | ||
| short * | wdRefNum | ||
| ) |
| OSErr PBAllocateAsync | ( | ParmBlkPtr | paramBlock | ) |
| void PBAllocateForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBAllocateForkSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBAllocateSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBAllocContigAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBAllocContigSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBCatalogSearchAsync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBCatalogSearchSync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBCatMoveAsync | ( | CMovePBPtr | paramBlock | ) |
| OSErr PBCatMoveSync | ( | CMovePBPtr | paramBlock | ) |
| OSErr PBCatSearchAsync | ( | CSParamPtr | paramBlock | ) |
| OSErr PBCatSearchSync | ( | CSParamPtr | paramBlock | ) |
| void PBCloseForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBCloseForkSync | ( | FSForkIOParam * | paramBlock | ) |
| void PBCloseIteratorAsync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBCloseIteratorSync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBCloseWDAsync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBCloseWDSync | ( | WDPBPtr | paramBlock | ) |
| void PBCompareFSRefsAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBCompareFSRefsSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBCreateAsync | ( | ParmBlkPtr | paramBlock | ) |
| void PBCreateDirectoryUnicodeAsync | ( | FSRefParam * | paramBlock | ) |
PBCreateDirectoryUnicodeAsync()
| OSErr PBCreateDirectoryUnicodeSync | ( | FSRefParam * | paramBlock | ) |
PBCreateDirectoryUnicodeSync()
| OSErr PBCreateFileIDRefAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBCreateFileIDRefSync | ( | HParmBlkPtr | paramBlock | ) |
| void PBCreateFileUnicodeAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBCreateFileUnicodeSync | ( | FSRefParam * | paramBlock | ) |
| void PBCreateForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBCreateForkSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBCreateSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBDeleteAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBDeleteFileIDRefAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBDeleteFileIDRefSync | ( | HParmBlkPtr | paramBlock | ) |
| void PBDeleteForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBDeleteForkSync | ( | FSForkIOParam * | paramBlock | ) |
| void PBDeleteObjectAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBDeleteObjectSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBDeleteSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBDirCreateAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBDirCreateSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBDTAddAPPLAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTAddAPPLSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTAddIconAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTAddIconSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTCloseDown | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTDeleteAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTDeleteSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTFlushAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTFlushSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetAPPLAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetAPPLSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetCommentAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetCommentSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetIconAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetIconInfoAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetIconInfoSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetIconSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetInfoAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetInfoSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTGetPath | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTOpenInform | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTRemoveAPPLAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTRemoveAPPLSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTRemoveCommentAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTRemoveCommentSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTResetAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTResetSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTSetCommentAsync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBDTSetCommentSync | ( | DTPBPtr | paramBlock | ) |
| OSErr PBEject | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBExchangeFilesAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBExchangeFilesSync | ( | HParmBlkPtr | paramBlock | ) |
| void PBExchangeObjectsAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBExchangeObjectsSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBFlushFileAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBFlushFileSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBFlushForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBFlushForkSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBFlushVolAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBFlushVolSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBGetCatalogInfoAsync | ( | FSRefParam * | paramBlock | ) |
| void PBGetCatalogInfoBulkAsync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBGetCatalogInfoBulkSync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBGetCatalogInfoSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBGetCatInfoAsync | ( | CInfoPBPtr | paramBlock | ) |
| OSErr PBGetCatInfoSync | ( | CInfoPBPtr | paramBlock | ) |
| OSErr PBGetEOFAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetEOFSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetFCBInfoAsync | ( | FCBPBPtr | paramBlock | ) |
| OSErr PBGetFCBInfoSync | ( | FCBPBPtr | paramBlock | ) |
| OSErr PBGetFInfoAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetFInfoSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetForeignPrivsAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBGetForeignPrivsSync | ( | HParmBlkPtr | paramBlock | ) |
| void PBGetForkCBInfoAsync | ( | FSForkCBInfoParam * | paramBlock | ) |
| OSErr PBGetForkCBInfoSync | ( | FSForkCBInfoParam * | paramBlock | ) |
| void PBGetForkPositionAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBGetForkPositionSync | ( | FSForkIOParam * | paramBlock | ) |
| void PBGetForkSizeAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBGetForkSizeSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBGetFPosAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetFPosSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetUGEntryAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBGetUGEntrySync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBGetVInfoAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetVInfoSync | ( | ParmBlkPtr | paramBlock | ) |
PBOpenSync(), PBOpenAsync(), PBOpenImmed() were moved to Devices.h PBCloseSync(), PBCloseAsync(), PBCloseImmed() were moved to Devices.h PBReadSync(), PBReadAsync(), PBReadImmed() were moved to Devices.h PBWriteSync(), PBWriteAsync(), PBWriteImmed() were moved to Devices.h PBGetVInfoSync()
| OSErr PBGetVolAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBGetVolMountInfo | ( | ParmBlkPtr | paramBlock | ) |
PBGetVolMountInfo Places volume mounting information into a buffer.
Use PBGetVolMountInfo to place the mounting information for a specified volume into the buffer pbis a pointer to a IOParam structure.The relevant fields are as follows: Out-In Name Type SizeOffsetDescription →ioCompletion ProcPtr 412Completion routine address (if async =TRUE) ←ioResult short 216Error Code (0=no error, 1=not done yet) →ioVRefNum short 222Volume or working directory reference →ioBuffer Ptr 432Pointer to mounting information
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) Volume not found paramErr (-50) Parameter error extFSErr (-58) External file system error; typically, function is not available for that volume
PBGetVolMountInfo places the mounting information for a specified volume into the buffer pointed to by the ioBuffer field. The mounting information for an AppleShare volume is stored as an AFP mounting record. The length of the buffer is specified by the value pointed to by the ioBuffer field in a previous call to PBGetVolMountInfoSize . PBGetVolMountInfo does not return the user password or volume password in the AFPVolMountInfo record. Your application solicits these passwords from the user and fills in the record before attempting to mount the remote volume.
| OSErr PBGetVolMountInfoSize | ( | ParmBlkPtr | paramBlock | ) |
PBGetVolMountInfoSize Determine space allocation for volume-mounting record.
Use PBGetVolMountInfoSize to determine how much space to allocate for the volume-mounting record. pbis a pointer to a IOParam structure.The relevant fields are as follows: Out-In Name Type SizeOffsetDescription →ioCompletion ProcPtr 412Completion routine address (if async =TRUE) ←ioResult short 216Error Code (0=no error, 1=not done yet) →ioVRefNum short 222Volume or working directory reference →ioBuffer Ptr 432pointer to storage for size (4 bytes of storage)
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) Volume not found paramErr (-50) Parameter error extFSErr (-58) External file system error; typically, function is not available for that volume
For a specified volume, the PBGetVolMountInfoSize function provides the size of the record needed to hold the volume's mounting information. After ascertaining the size of the record needed and allocating storage, you call the PBGetVolMountInfo function to retrieve a record containing all the information needed to mount the volume, except for passwords. You can later pass this record to the PBVolumeMount function to mount the volume.
| OSErr PBGetVolSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBGetVolumeInfoAsync | ( | FSVolumeInfoParam * | paramBlock | ) |
| OSErr PBGetVolumeInfoSync | ( | FSVolumeInfoParam * | paramBlock | ) |
| OSErr PBGetWDInfoAsync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBGetWDInfoSync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBGetXCatInfoAsync | ( | XCInfoPBPtr | paramBlock | ) |
| OSErr PBGetXCatInfoSync | ( | XCInfoPBPtr | paramBlock | ) |
| OSErr PBHCopyFileAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHCopyFileSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHCreateAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHCreateSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHDeleteAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHDeleteSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetDirAccessAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetDirAccessSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetFInfoAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetFInfoSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetLogInInfoAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetLogInInfoSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetVInfoAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetVInfoSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetVolAsync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBHGetVolParmsAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetVolParmsSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHGetVolSync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBHMapIDAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHMapIDSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHMapNameAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHMapNameSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHMoveRenameAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHMoveRenameSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenDenyAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenDenySync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenDFAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenDFSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenRFAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenRFDenyAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenRFDenySync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenRFSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHOpenSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHRenameAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHRenameSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHRstFLockAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHRstFLockSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetDirAccessAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetDirAccessSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetFInfoAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetFInfoSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetFLockAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetFLockSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBHSetVolAsync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBHSetVolSync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBHTrashVolumeCachesSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBIterateForksAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBIterateForksSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBLockRangeAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBLockRangeSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBMakeFSRefAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBMakeFSRefSync | ( | FSRefParam * | paramBlock | ) |
| void PBMakeFSRefUnicodeAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBMakeFSRefUnicodeSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBMakeFSSpecAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBMakeFSSpecSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBMountVol | ( | ParmBlkPtr | paramBlock | ) |
| void PBMoveObjectAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBMoveObjectSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBOffLine | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBOpenDFAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBOpenDFSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBOpenForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBOpenForkSync | ( | FSForkIOParam * | paramBlock | ) |
| void PBOpenIteratorAsync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBOpenIteratorSync | ( | FSCatalogBulkParam * | paramBlock | ) |
| OSErr PBOpenRFAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBOpenRFSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBOpenWDAsync | ( | WDPBPtr | paramBlock | ) |
| OSErr PBOpenWDSync | ( | WDPBPtr | paramBlock | ) |
| void PBReadForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBReadForkSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBRenameAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBRenameSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBRenameUnicodeAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBRenameUnicodeSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBResolveFileIDRefAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBResolveFileIDRefSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBRstFLockAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBRstFLockSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBSetCatalogInfoAsync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBSetCatalogInfoSync | ( | FSRefParam * | paramBlock | ) |
| OSErr PBSetCatInfoAsync | ( | CInfoPBPtr | paramBlock | ) |
| OSErr PBSetCatInfoSync | ( | CInfoPBPtr | paramBlock | ) |
| OSErr PBSetEOFAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetEOFSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFInfoAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFInfoSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFLockAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFLockSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetForeignPrivsAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBSetForeignPrivsSync | ( | HParmBlkPtr | paramBlock | ) |
| void PBSetForkPositionAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBSetForkPositionSync | ( | FSForkIOParam * | paramBlock | ) |
| void PBSetForkSizeAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBSetForkSizeSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBSetFPosAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFPosSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFVersAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetFVersSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetVInfoAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBSetVInfoSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBSetVolAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBSetVolSync | ( | ParmBlkPtr | paramBlock | ) |
| void PBSetVolumeInfoAsync | ( | FSVolumeInfoParam * | paramBlock | ) |
| OSErr PBSetVolumeInfoSync | ( | FSVolumeInfoParam * | paramBlock | ) |
| OSErr PBShareAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBShareSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBUnlockRangeAsync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBUnlockRangeSync | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBUnmountVol | ( | ParmBlkPtr | paramBlock | ) |
Flush volume, close its files, release its memory.
PBUnmountVol flushes a volume buffer to disk and releases all memory occupied by the volume buffer and related structures. The volume must be re-mounted before it can be accessed. pbis the address of a 64-byte VolumeParam structure or any of the variants which contain all the relevant fields: Out-In Name Type SizeOffsetDescription ->ioCompletion ProcPtr 412Completion routine address (if async =TRUE) ->ioNamePtr StringPtr 418Address of volume name (or NIL) ->ioVRefNum short 222Volume reference number of volume to unmount <-ioResult OSErr 216Error Code (0=no error, 1=not done yet)
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name fBsyErr (-47) Files are open on volume extFSErr (-58) External file system nsDrvErr (-56) No such drive nsvErr (-35) No such volume paramErr (-50) No default volume
Don't unmount the startup volume. If you are using a string in the ioNamePtr field to specify a volume name, the string must be in the following form myVolParam.ioNamePtr = "\pMy HardDisk:" The trailing colon on the string indicates that we are referring to a directory, not a file. All files on a volume must be closed in order for PBUnmountVol to succeed. A fBsyErr will be received if this is not the case. PBUnmountVol is typically called just before PBEject - when the disk will not be needed again for a while. Use PBMountVol if you need to remount the volume. PBOffLine is related; the volume buffer is ditched but its control block remains in memory so that GetVInfo will continue to return information. Later, the volume can be brought back online transparently, by the File Manager, when needed.
| OSErr PBUnmountVolImmed | ( | ParmBlkPtr | paramBlock | ) |
| OSErr PBUnshareAsync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBUnshareSync | ( | HParmBlkPtr | paramBlock | ) |
| OSErr PBVolumeMount | ( | ParmBlkPtr | paramBlock | ) |
| void PBWriteForkAsync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBWriteForkSync | ( | FSForkIOParam * | paramBlock | ) |
| OSErr PBXGetVolInfoAsync | ( | XVolumeParamPtr | paramBlock | ) |
| OSErr PBXGetVolInfoSync | ( | XVolumeParamPtr | paramBlock | ) |
| printf | ( | ) |
Obtain pointer to the volume control block queue header.
GetVCBQHdr returns the standard Operating System queue's header address, which is used to maintain the linked-list of volume control blocks. There is one VCB entry for every online volume, whether it is currently mounted or not.
a 32-bit QHdrPtr; the address of the 10-byte QHdr structure whose qLink field points to the first volume control block in the queue.
C programmers may prefer to get this address from the global variable VCBQHdr (at 0x0356). The global variable DefVCBPtr points directly to the VCB of the current default volume. It is probably a mistake to manipulate this queue directly, but if you need to, you can use the OS Utilities functions Enqueue and Dequeue , passing VCBQHdr as the queue you wish to modify. Nearly everything you'll ever want to know about volumes can be obtained via PBGetVInfo (which lets you easily index through the list). If you are running under HFS, the queue elements are 178-byte VCB structures. If you booted with a flat file system, the queue is made up of structures which include only the first 94-bytes of the VCB structure. The qLink field of either structure points to the next such structure in the chain or is 0 to indicate the end of the chain. The following example illustrates how to access the VCB queue. Example #include < Files.h> #include < OSUtils.h > QHdrPtr qhp; VCB vcbp; qhp= GetVCBQHdr (); / address of queue header
| OSErr Rename | ( | ConstStr255Param | oldName, |
| short | vRefNum, | ||
| ConstStr255Param | newName | ||
| ) |
Change the name of a file or directory.
Rename renames a file or directory. This simply changes the text of the name; it cannot be used to move a file to a different directory (see PBCatMove ). oldName is the address of a length-prefixed, pascal-style string containing the current name of the file or directory (directory names should end with a colon ":"). vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . Use 0 to specify the default volume. newName is the address of a length-prefixed, pascal-style string containing the desired new name for the file or directory (directory names should end with a colon ":").
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Bad name, newName is different type from oldName dirFulErr (-33) Directory full dirNFErr (-120) Directory not found dupFNErr (-48) Duplicate filename ( newName already exists) extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found fsRnErr (-59) Rename error ioErr(-36) I/O error nsvErr (-35) No such volume paramErr (-50) No default volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
The vRefNum parameter describes the volume or directory in which the item to rename currently resides. You may use a "hard" volume number, or a working directory reference as returned by Standard File. Both filenames must resolve to entries in the same directory; i.e., if oldName is a fully-qualified three-name pathspec, then newName must also provide that same information, with only the final element in the name changing. For instance: Rename ( "\pHardDisk:Ltrs: Smith", 0, "\pHardDisk:Ltrs: Jones" ); When you rename a directory or volume, both names should end in a colon, e.g.: Rename ( "\pHardDisk:", 0, "\pEasyDisk:" );
| OSErr rstflock | ( | const char * | fileName, |
| short | vRefNum | ||
| ) |
| OSErr RstFLock | ( | ConstStr255Param | fileName, |
| short | vRefNum | ||
| ) |
Unlock a file (allow changes, deletion, renaming, etc.)
RstFLock locks a file; it undoes the effect of SetFLock . This allows programs to delete, rename, or write data to it. fileName is the address of a length-prefixed, pascal-style string containing the name of the file to be unlocked. It may be a partial or full pathname, depending upon the value of vRefNum . vRefNum is the reference number of the volume or working directory that contains the file or directory fileName . Use 0 to specify the default volume.
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
This clears the file's "lock" flag (as found in the ioFlAttrib field of the FileParam structure) and notifies the system of the change (Note: changing this bit directly, e.g., via PBSetCatInfo , may not be noticed by the Finder until the file's folder is closed and reopened or the system is restarted). This does not affect currently-open access paths. Thus, if some other process has opened the file, locking it will not prevent the other program from continuing to modify it. See SetFLock for related details. You can lock/unlock an entire volume via PBSetVInfo or lock a selected portion of an open file via PBLockRange . Use PBGetFInfo to see if a file is currently locked (ioFlAttrib bit 1 is set).
| OSErr SetEOF | ( | short | refNum, |
| long | logEOF | ||
| ) |
Increase or decrease the logical size of a file.
Use SetEOF to change the size of a file to any arbitrary length. Disk blocks are allocated or released to accommodate the request. fRefNum is the reference number of an open file. See FSOpen and OpenRF . newEOF is the desired new size of the file, in bytes.
an operating system Error Code . It will be one of: noErr(0) No error dskFulErr (-34) Disk full (partial allocation made) extFSErr (-58) External file system fLckdErr (-45) File is locked fnOpnErr (-38) File not open ioErr(-36) I/O error rfNumErr (-51) Bad fRefNum vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected wrPermErr (-61) Write permissions error
If newEOF is larger than the current file size (see GetEOF), the file size is increased by allocating additional disk blocks to the physical EOF (if needed). If there is not enough available disk space to satisfy the entire request the dskFulErr is returned and no new space is allocated. You can also use Allocate to increase the size of a file. The PBAllocContig function may be preferable since it attempts to allocate contiguous blocks (for best read/write performance). If newEOF is smaller than the current size and if the new size is small enough to fit in fewer allocation blocks, disk blocks will be released as the file is truncated. For instance, SetEOF( fRef, 0 ); sets the logical end-of-file to 0 and releases all the disk blocks allocated to the file (thus, freeing up space on the disk).
| OSErr setfinfo | ( | const char * | fileName, |
| short | vRefNum, | ||
| const FInfo * | fndrInfo | ||
| ) |
| OSErr SetFInfo | ( | ConstStr255Param | fileName, |
| short | vRefNum, | ||
| const FInfo * | fndrInfo | ||
| ) |
Change file type, creator, icon position, etc.
SetFInfo changes Finder-specific information about a file. This includes the file's type, the signature of its creator, Finder flags (such as whether the icon is displayed), and the display position of the file's icon within its window. fileName is the address of a length-prefixed, pascal-style string containing the name of the target file. It may be a partial or full pathname, depending upon the value of vRefNum . vRefNum is the reference number of the volume or working directory containing the file or directory fileName . 0 indicates the default volume. fndrInfo is the address of a 16-byte FInfo structure containing the desired values of Finder specific information to be changed. Normal usage is to pre-set all fields with current values by first calling GetFInfo , then change only those fields which you wish to modify.
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fLckdErr (-45) File is locked fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
SetFInfo is a functional subset of the low-level PBSetFInfo call (which allows you to change the file's date/time information as well as its Finder-specific data). The FInfo structure maintains the primary information used by the Finder in locating the icon to display, where to display it, and which application to run when its icon is double-clicked. It is the same information as in the ioFlFndrInfo field of the FileParam structure, which is passed to custom "file filters" used in the Standard File Package (see SFGetFile ). Additional Finder information is maintained in an FXInfo structure, which can be obtained via PBGetCatInfo . In all operations in which you modify file-descriptive information, the normal usage is to obtain a copy of the current information before modifying selected fields and updating the disk, as in the following example. Example
| OSErr setflock | ( | const char * | fileName, |
| short | vRefNum | ||
| ) |
| OSErr SetFLock | ( | ConstStr255Param | fileName, |
| short | vRefNum | ||
| ) |
Lock a file (prevent changes, deletion, renaming, etc.)
SetFLock locks a file. This prevents programs from modifying it in any way
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnfErr(-43) File not found ioErr(-36) I/O error nsvErr (-35) No such volume vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected
This sets the file's "lock" flag (as found in the ioFlAttrib field of the FileParam structure) and notifies the system of the change (Note: if you change this bit directly, as with PBSetCatInfo , the change may not be noticed by the Finder until the file's folder is closed and reopened or the system is restarted). This prevents programs from deleting ( FSDelete ), renaming ( Rename ), or writing ( FSWrite ) to the file. Any attempt to open the file ( FSOpen) for read/write access will fail. Of course, any process can unlock the file (via RstFLock ) if it wants such access. This has no affect on currently-open access paths. Thus, you can open a file for writing, then lock it to prevent other concurrent processes from writing to it. Afterward, use RstFLock to unlock the file. You can lock/unlock an entire volume via PBSetVInfo or lock a selected portion of an open file via PBLockRange . Use PBGetFInfo to see if a file is currently locked (ioFlAttrib bit 1 is set). Be sure to call FlushVol to make sure that the change is written to the disk in a timely manner.
| OSErr SetFPos | ( | short | refNum, |
| short | posMode, | ||
| long | posOff | ||
| ) |
Position file mark for random-access read/write.
SetFPos sets the position of the file mark (the file position at which the next read or write operation will start). fRefNum is the reference number of an open file. See FSOpen and OpenRF . posMode specifies the method by which the file pointer will be moved. The following constants are defined in Files.h: fsAtMark 0Remain at current mark ( posOffset is ignored) fsFromStart 1Move to absolute file position in posOffset fsFromLEOF 2Move posOffset bytes from logical end of file fsFromMark 3Move posOffset bytes from current position posOffset is a signed long integer (positive or negative); it identifies how far to move the file mark. The resulting absolute file position will depend upon the method specified by posMode.
an operating system Error Code . It will be one of: noErr(0) No error eofErr (-39) Attempt tp position past the end-of-file extFSErr (-58) External file system fnOpnErr (-38) File not open ioErr(-36) I/O error posErr (-40) Can't position to before start of file rfNumErr (-51) Bad fRefNum
SetFPos (LSEEK to UNIX fans) is used in random-access disk operations to position the file mark to a specified position in order to read from or write to a selected position in the file. This function is not needed in sequential file I/O, since the file mark is updated automatically via FSRead and FSWrite . The posOffset parameter may be positive or negative. If the combination of posMode and a positive posOffset would move past the end of the file, the mark is set to the EOF and eofErr is returned. If you attempt to position the file mark before the start of the file (i.e., while using a negative value in posOffset ) posErr is returned. If you wish to append records to the end of the file, simply use posMode=fsFromLEOF and posOffset =0 (see FSWrite for an example). If you need to seek beyond the end of the file, you can use Allocate or SetEOF to add empty space to the end of the file before using SetFPos . Some examples: FSOpen( "\pHardDisk:MyFile", 0, &fRef );
| OSErr setvol | ( | const char * | volName, |
| short | vRefNum | ||
| ) |
| OSErr unmountvol | ( | const char * | volName, |
| short | vRefNum | ||
| ) |
| OSErr UnmountVol | ( | ConstStr63Param | volName, |
| short | vRefNum | ||
| ) |
Flush volume, close its files, release its memory.
All files on a volume must be closed in order for UnmountVol to succeed. A fBsyErr will be received if this is not the case. UnmountVol is typically called just before calling Eject - when the disk will not be needed again. Use PBMountVol to re-mount the volume, or (most commonly) let Standard File take care of mounting and unmounting. A related call is PBOffLine , which retains the volume control block in memory so that GetVInfo will continue to return information and the volume can be brought back online transparently, by the File Manager, when needed.
| AccessParam accessParam |
Used in shared environment calls
| This attempts to extend the file by byte |
Increase the physical size of an open file.
Allocate extends the physical size of a file on disk, without changing the file's logical EOF. fRefNum is the reference number of an open file. See FSOpen and OpenRF . byteCount is the address of a positive long integer. On entry, it specifies how much space, in bytes, you wish to add to the file's physical allocation. Upon return, it contains the actual number of bytes added (it will be a multiple of the disk block size).
an operating system Error Code . It will be one of: noErr(0) No error dskFulErr (-34) Disk full fLckdErr (-45) File is locked fnOpnErr (-38) File not open ioErr(-36) I/O error rfNumErr (-51) Bad fRefNum vLckdErr (-46) Volume is locked wPrErr (-44) Diskette is write-protected wrPermErr (-61) Write permission error
The byteCount parameter is added to the current physical end-of-file, the sum is rounded up to the size of the next higher allocation block, and the File Manager attempts to allocate enough blocks to satisfy the request. If there is not enough free space on the disk, then all available space is allocated , the byteCount variable is set to the actual number of bytes allocated, and dskFulErr is returned. Hint: you may wish to shrink the file back down if the allocation fails (see SetEOF). Note that Allocate works in disk-block size units, with no regard to the logical EOF. For instance: longbyteCount; shortfRef; byteCount = 1; Allocate ( fRef, &byteCount ); /* add 1 byte to the file
| CopyParam copyParam |
Used in shared environment calls
| </ pre> * par Copyright |
Generally used in I/O for open files
| CSParam csParam |
Used by PBCatSearch
| err = SetVol("\pMy HardDisk:", 0) |
Select a new default volume or working directory.
SetVol selects a volume or working directory to become the default. volName is the address of a length-prefixed, pascal-style string containing the name of the volume you wish to set as the default. Character case is ignored. If volName is NIL (0), the vRefNum parameter will be used. vRefNum is the reference number of the volume or working directory you wish to select as the new default. This parameter is used only if volName is invalid or NIL.
an operating system Error Code . It will be one of: noErr(0) No error bdNamErr (-37) Invalid volName nsvErr (-35) No such volume paramErr (-50) No default volume
SetVol lets you select a default volume for use in subsequent file operations where you do not specify a volume name or reference number. There is seldom any need for this since the Standard File Package functions return a volume reference indicating where a file is (or where the user wants it to go). You can specify the desired volume by either a single name or a volume reference number; e.g.: err = SetVol( 0, theRefNum ); /* set by reference number
| FIDParam fidParam |
Used in calls which manipulate File
| HFileParam fileParam |
Used for unopened files
| ForeignPrivParam foreignPrivParam |
Used for communication with foreign
| HIOParam* hipb = (HIOParam *)&hpb |
This union (or either of the HFileInfo or DirInfo structures) is used in calls to PBGetCatInfo and PBSetCatInfo . Note that the return value of the ioFlAttrib field (of either member structure) identifies which type of information is returned (see PBGetCatInfo for details). A handy technique is to allocate the CInfoPBRec union and create pointers which refer to each data type: CInfoPBRec cipb; /* allocate a union */ HFileInfo *hfipb = (HFileInfo *) /* and separate struc ptrs */ DirInfo *dipb = (DirInfo *) /* pointing same address */ cipb.hFileInfo.vRefNum = 2; /* as a union member field */ cipb.dirInfo.ioDrFndrInfo.frLocation.h = 100; hfipb->vRefNum = 2; /* or as a structure field */ dipb->ioDrFndrInfo.frLocation.h = 100; You can also perform ad hoc type coercion : unsigned char pb[108]; /* big enough to hold either struct */ short theVRef; theVRef = ((HFileInfo *)pb)->ioVRefNum; /* fetch 1 field */ ((HFileParam *)pb)->ioFlLgLen = 1000L; /* change some fields */ ((HFileInfo *)pb)->ioFlClpSiz = 2048; GetDateTime(&((HFileInfo *)pb)->ioFlMdDat); /* access chars of a long */ printf("File type is '%c%c%c%c'\n", pb[32], pb[33], pb[34], pb[35]); </ pre>
/
union CInfoPBRec
{
HFileInfo hFileInfo; /**< Use for files*/
DirInfo dirInfo; /**< Use for directories*/
} CInfoPBRec; /**< (size of aggregate)*/
typedef union CInfoPBRec CInfoPBRec;
typedef CInfoPBRec *CInfoPBPtr;
struct XCInfoPBRec
{
QElemPtr qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
ProcPtr ioCompletion; /* --> A pointer to a completion routine */
volatile OSErr ioResult; /* --> The result code of the function */
StringPtr ioNamePtr; /* --> Pointer to pathname to object */
short ioVRefNum; /* --> A volume specification */
long filler1;
StringPtr ioShortNamePtr; /* <-> A pointer to the short name string buffer -
required! */
short filler2;
short ioPDType; /* <-- The ProDOS file type */
long ioPDAuxType; /* <-- The ProDOS aux type */
long filler3[2];
long ioDirID; /* --> A directory ID */
};
typedef struct XCInfoPBRec XCInfoPBRec;
typedef XCInfoPBRec *XCInfoPBPtr;
/* Catalog position record */
struct CatPositionRec
{
long initialize;
short priv[6];
};
typedef struct CatPositionRec CatPositionRec;
struct FSSpec
{
short vRefNum;
long parID;
StrFileName name; /* a Str63 on MacOS*/
};
typedef struct FSSpec FSSpec;
typedef FSSpec *FSSpecPtr;
typedef FSSpecPtr *FSSpecHandle;
/* pointer to array of FSSpecs */
typedef FSSpecPtr FSSpecArrayPtr;
/**
The only difference between "const FSSpec*" and "ConstFSSpecPtr" is
that as a parameter, ConstFSSpecPtr is allowed to be NULL
*/
typedef const FSSpec *ConstFSSpecPtr;
/**
The following are structures to be filled out with the _PBGetVolMountInfo
call and passed back into the _PBVolumeMount call for external file system
mounts.
*/
/* the "signature" of the file system */
typedef OSType VolumeType;
enum
{
/* the signature for AppleShare */
AppleShareMediaType = FOUR_CHAR_CODE('afpm')
};
/**
VolMount stuff was once in FSM.©
*/
struct VolMountInfoHeader
{
short length; /* length of location data (including self) */
VolumeType media; /* type of media. Variable length data follows */
};
typedef struct VolMountInfoHeader VolMountInfoHeader;
typedef VolMountInfoHeader *VolMountInfoPtr;
/* The new volume mount info record. The old one is included for compatibility.
the new record allows access by foriegn filesystems writers to the flags
portion of the record. This portion is now public.
*/
struct VolumeMountInfoHeader
{
short length; /* length of location data (including self) */
VolumeType media; /* type of media (must be registered with Apple) */
short flags; /* volume mount flags. Variable length data follows */
};
typedef struct VolumeMountInfoHeader VolumeMountInfoHeader;
typedef VolumeMountInfoHeader *VolumeMountInfoHeaderPtr;
/* volume mount flags */
enum
{
volMountNoLoginMsgFlagBit =
0, /* Input to VolumeMount: If set, the file system */
volMountNoLoginMsgFlagMask =
0x0001, /* should suppresss any log-in message/greeting dialog */
volMountExtendedFlagsBit =
7, /* Input to VolumeMount: If set, the mount info is a */
volMountExtendedFlagsMask =
0x0080, /* AFPXVolMountInfo record for 3.7 AppleShare Client */
volMountInteractBit =
15, /* Input to VolumeMount: If set, it's OK for the file system */
volMountInteractMask =
0x8000, /* to perform user interaction to mount the volume */
volMountChangedBit =
14, /* Output from VoumeMount: If set, the volume was mounted, but */
volMountChangedMask =
0x4000, /* the volume mounting information record needs to be updated. */
volMountFSReservedMask =
0x00FF, /* bits 0-7 are defined by each file system for its own use */
volMountSysReservedMask =
0xFF00 /* bits 8-15 are reserved for Apple system use */
};
struct AFPVolMountInfo
{
short length; /* length of location data (including self) */
VolumeType media; /* type of media */
short flags; /* bits for no messages, no reconnect */
SInt8 nbpInterval; /* NBP Interval parameter (IM2, p.322) */
SInt8 nbpCount; /* NBP Interval parameter (IM2, p.322) */
short uamType; /* User Authentication Method */
short zoneNameOffset; /* short positive offset from start of struct to Zone
Name */
short serverNameOffset; /* offset to pascal Server Name string */
short volNameOffset; /* offset to pascal Volume Name string */
short userNameOffset; /* offset to pascal User Name string */
short userPasswordOffset; /* offset to pascal User Password string */
short volPasswordOffset; /* offset to pascal Volume Password string */
char AFPData[144]; /* variable length data may follow */
};
typedef struct AFPVolMountInfo AFPVolMountInfo;
typedef AFPVolMountInfo *AFPVolMountInfoPtr;
/* AFPXVolMountInfo is the new AFP volume mount info record, requires the 3.7
AppleShare Client */
struct AFPXVolMountInfo
{
short length; /* length of location data (including self) */
VolumeType media; /* type of media */
short flags; /* bits for no messages, no reconnect */
SInt8 nbpInterval; /* NBP Interval parameter (IM2, p.322) */
SInt8 nbpCount; /* NBP Interval parameter (IM2, p.322) */
short uamType; /* User Authentication Method type */
short zoneNameOffset; /* short positive offset from start of struct to Zone
Name */
short serverNameOffset; /* offset to pascal Server Name string */
short volNameOffset; /* offset to pascal Volume Name string */
short userNameOffset; /* offset to pascal User Name string */
short userPasswordOffset; /* offset to pascal User Password string */
short volPasswordOffset; /* offset to pascal Volume Password string */
short extendedFlags; /* extended flags word */
short uamNameOffset; /* offset to a pascal UAM name string */
short alternateAddressOffset; /* offset to Alternate Addresses in tagged
format */
char AFPData[176]; /* variable length data may follow */
};
typedef struct AFPXVolMountInfo AFPXVolMountInfo;
typedef AFPXVolMountInfo *AFPXVolMountInfoPtr;
enum
{
kAFPExtendedFlagsAlternateAddressMask =
1 /* bit in AFPXVolMountInfo.extendedFlags that means
alternateAddressOffset is used*/
};
enum
{
/* constants for use in AFPTagData.fType field*/
kAFPTagTypeIP = 0x01, /* 4 byte IP address (MSB first) */
kAFPTagTypeIPPort = 0x02, /* 4 byte IP address, 2 byte port (MSB first) */
kAFPTagTypeDDP = 0x03, /* Net,Node,Socket Sent by the server, currently unused
by the client */
kAFPTagTypeDNS = 0x04 /* DNS name in address:port format (total length
variable up to 254 chars of dns name) */
};
enum
{
/* constants for use in AFPTagData.fLength field*/
kAFPTagLengthIP = 0x06,
kAFPTagLengthIPPort = 0x08,
kAFPTagLengthDDP = 0x06
};
struct AFPTagData
{
UInt8 fLength; /* length of this data tag including the fLength field */
UInt8 fType;
UInt8 fData[1]; /* variable length data */
};
typedef struct AFPTagData AFPTagData;
struct AFPAlternateAddress
{
/* ©©©©NOTE: fVersion was missing in 3.2 Universal Interfaces*/
UInt8 fVersion; /* version of the structure (currently 0x00)*/
UInt8 fAddressCount;
UInt8 fAddressList[1]; /* actually variable length packed set of AFPTagData */
};
typedef struct AFPAlternateAddress AFPAlternateAddress;
struct DTPBRec
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short ioDTRefNum; /* desktop refnum */
short ioIndex;
long ioTagInfo;
Ptr ioDTBuffer;
long ioDTReqCount;
long ioDTActCount;
SInt8 ioFiller1;
UInt8 ioIconType;
short ioFiller2;
long ioDirID;
OSType ioFileCreator;
OSType ioFileType;
long ioFiller3;
long ioDTLgLen;
long ioDTPyLen;
short ioFiller4[14];
long ioAPPLParID;
};
typedef struct DTPBRec DTPBRec;
typedef DTPBRec *DTPBPtr;
struct HIOParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short ioRefNum;
SInt8 ioVersNum;
SInt8 ioPermssn;
Ptr ioMisc;
Ptr ioBuffer;
long ioReqCount;
long ioActCount;
short ioPosMode;
long ioPosOffset;
};
typedef struct HIOParam HIOParam;
typedef HIOParam *HIOParamPtr;
struct HFileParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short ioFRefNum;
SInt8 ioFVersNum;
SInt8 filler1;
short ioFDirIndex;
SInt8 ioFlAttrib;
SInt8 ioFlVersNum;
FInfo ioFlFndrInfo;
long ioDirID;
unsigned short ioFlStBlk;
long ioFlLgLen;
long ioFlPyLen;
unsigned short ioFlRStBlk;
long ioFlRLgLen;
long ioFlRPyLen;
unsigned long ioFlCrDat;
unsigned long ioFlMdDat;
};
typedef struct HFileParam HFileParam;
typedef HFileParam *HFileParamPtr;
struct HVolumeParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
long filler2;
short ioVolIndex;
unsigned long ioVCrDate;
unsigned long ioVLsMod;
short ioVAtrb;
unsigned short ioVNmFls;
unsigned short ioVBitMap;
unsigned short ioAllocPtr;
unsigned short ioVNmAlBlks;
unsigned long ioVAlBlkSiz;
unsigned long ioVClpSiz;
unsigned short ioAlBlSt;
unsigned long ioVNxtCNID;
unsigned short ioVFrBlk;
unsigned short ioVSigWord;
short ioVDrvInfo;
short ioVDRefNum;
short ioVFSID;
unsigned long ioVBkUp;
short ioVSeqNum;
unsigned long ioVWrCnt;
unsigned long ioVFilCnt;
unsigned long ioVDirCnt;
long ioVFndrInfo[8];
};
typedef struct HVolumeParam HVolumeParam;
typedef HVolumeParam *HVolumeParamPtr;
struct XIOParam
{
QElemPtr qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
IOCompletionUPP ioCompletion;
volatile OSErr ioResult;
StringPtr ioNamePtr;
short ioVRefNum;
short ioRefNum;
SInt8 ioVersNum;
SInt8 ioPermssn;
Ptr ioMisc;
Ptr ioBuffer;
long ioReqCount;
long ioActCount;
short ioPosMode; /* must have kUseWidePositioning bit set */
wide ioWPosOffset; /* wide positioning offset */
};
typedef struct XIOParam XIOParam;
typedef XIOParam *XIOParamPtr;
struct XVolumeParam
{
QElemPtr qLink;
short qType;
short ioTrap;
Ptr ioCmdAddr;
IOCompletionUPP ioCompletion;
volatile OSErr ioResult;
StringPtr ioNamePtr;
short ioVRefNum;
unsigned long ioXVersion; /* this XVolumeParam version (0) */
short ioVolIndex;
unsigned long ioVCrDate;
unsigned long ioVLsMod;
short ioVAtrb;
unsigned short ioVNmFls;
unsigned short ioVBitMap;
unsigned short ioAllocPtr;
unsigned short ioVNmAlBlks;
unsigned long ioVAlBlkSiz;
unsigned long ioVClpSiz;
unsigned short ioAlBlSt;
unsigned long ioVNxtCNID;
unsigned short ioVFrBlk;
unsigned short ioVSigWord;
short ioVDrvInfo;
short ioVDRefNum;
short ioVFSID;
unsigned long ioVBkUp;
short ioVSeqNum;
unsigned long ioVWrCnt;
unsigned long ioVFilCnt;
unsigned long ioVDirCnt;
long ioVFndrInfo[8];
UInt64 ioVTotalBytes; /* total number of bytes on volume */
UInt64 ioVFreeBytes; /* number of free bytes on volume */
};
typedef struct XVolumeParam XVolumeParam;
typedef XVolumeParam *XVolumeParamPtr;
struct AccessParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short filler3;
short ioDenyModes; /*access rights data*/
short filler4;
SInt8 filler5;
SInt8 ioACUser; /*access rights for directory only*/
long filler6;
long ioACOwnerID; /*owner ID*/
long ioACGroupID; /*group ID*/
long ioACAccess; /*access rights*/
long ioDirID;
};
typedef struct AccessParam AccessParam;
typedef AccessParam *AccessParamPtr;
struct ObjParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short filler7;
short ioObjType; /*function code*/
StringPtr ioObjNamePtr; /*ptr to returned creator/group name*/
long ioObjID; /*creator/group ID*/
};
typedef struct ObjParam ObjParam;
typedef ObjParam *ObjParamPtr;
struct CopyParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short ioDstVRefNum; /*destination vol identifier*/
short filler8;
StringPtr ioNewName; /*ptr to destination pathname*/
StringPtr ioCopyName; /*ptr to optional name*/
long ioNewDirID; /*destination directory ID*/
long filler14;
long filler15;
long ioDirID;
};
typedef struct CopyParam CopyParam;
typedef CopyParam *CopyParamPtr;
struct WDParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
short ioWDCreated;
short ioWDIndex;
long ioWDProcID;
short ioWDVRefNum;
short filler10;
long filler11;
long filler12;
long filler13;
long ioWDDirID;
};
typedef struct WDParam WDParam;
typedef WDParam *WDParamPtr;
struct FIDParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
long filler14;
StringPtr ioDestNamePtr; /* dest file name */
long filler15;
long ioDestDirID; /* dest file's directory id */
long filler16;
long filler17;
long ioSrcDirID; /* source file's directory id */
short filler18;
long ioFileID; /* file ID */
};
typedef struct FIDParam FIDParam;
typedef FIDParam *FIDParamPtr;
struct ForeignPrivParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
long ioFiller21;
long ioFiller22;
Ptr ioForeignPrivBuffer;
long ioForeignPrivActCount;
long ioForeignPrivReqCount;
long ioFiller23;
long ioForeignPrivDirID;
long ioForeignPrivInfo1;
long ioForeignPrivInfo2;
long ioForeignPrivInfo3;
long ioForeignPrivInfo4;
};
typedef struct ForeignPrivParam ForeignPrivParam;
typedef ForeignPrivParam *ForeignPrivParamPtr;
struct CSParam
{
QElemPtr qLink; /*queue link in header*/
short qType; /*type byte for safety check*/
short ioTrap; /*FS: the Trap*/
Ptr ioCmdAddr; /*FS: address to dispatch to*/
IOCompletionUPP ioCompletion; /*completion routine addr (0 for synch calls)*/
volatile OSErr ioResult; /*result code*/
StringPtr ioNamePtr; /*ptr to Vol:FileName string*/
short ioVRefNum; /*volume refnum (DrvNum for Eject and MountVol)*/
FSSpecPtr ioMatchPtr; /* match array */
long ioReqMatchCount; /* maximum allowable matches */
long ioActMatchCount; /* actual match count */
long ioSearchBits; /* search criteria selector */
CInfoPBPtr ioSearchInfo1; /* search values and range lower bounds */
CInfoPBPtr ioSearchInfo2; /* search values and range upper bounds */
long ioSearchTime; /* length of time to run search */
CatPositionRec ioCatPosition; /* current position in the catalog */
Ptr ioOptBuffer; /* optional performance enhancement buffer */
long ioOptBufSize; /* size of buffer pointed to by ioOptBuffer */
};
typedef struct CSParam CSParam;
typedef CSParam *CSParamPtr;
/**
union structure)
convention
All ten structures on this union share the same names for the first eight fields (the first 24 bytes). These fields are also the same in the flat file system version ParamBlockRec . These common fields are defined in a macro as the ParamBlockHeader . This is the HFS variation of the ParamBlockRec . It should be used in HFS-specific calls ( PBHxxx). A typical technique for using parameter blocks is to allocate the HParamBlockRec union and create pointers that refer to the relevant structure data types: HParamBlockRec hpb; /* allocate a union
| ObjParam objParam |
Used in shared environment calls
| rc = FSDelete("\pHardDisk:Ltrs:", 0) |
Obtain the size of an open file (logical EOF)
Use GetEOF to find the current size of a file (its logical end-of-file position). fRefNum is the reference number of an open file. See FSOpen and OpenRF . curEOFis the address of long integer. Upon return, it will contain the file position of the logical end-of-file; i.e., the size of the file, in bytes.
an operating system Error Code . It will be one of: noErr(0) No error extFSErr (-58) External file system fnOpnErr (-38) File not open ioErr(-36) I/O error rfNumErr (-51) Bad fRefNum
Use GetEOF to learn the size of file. This and all high-level file operations refer to the logical end-of-file, as opposed to the physical EOF. Note: The physical EOF is always greater than or equal to the logical EOF, is a multiple of the size of an allocation unit (usually 1K), and has no significance for most applications. The following example opens a file, allocates a memory buffer to hold all of its data, and reads the data into the buffer. See OpenRF for an example program that copies the contents of both forks of one file to another and uses this function to learn the size of the file. Example #include < Files.h> #include < Memory.h > short fRef, rc; long fileSize; Handle hData; /* handle to buffer to be allocated
| </pre > *par StringPtr volName |
Get volume name, reference number and free bytes.
Given a physical drive number, GetVInfo returns information about the volume mounted in that drive. Remember that since GetVInfo is only glue that fills in a parameter block for you and then calls PBGetVInfo , the values returned from it are subject to the limitations (imposed by MFS) of unsigned shorts for the ioVNmAlBlks and ioVFrBlk fields of the parameter block. If the actual numbers are larger than what fits in an unsigned short, they will be clipped to 31744. drvNum identifies the physical drive of interest. Historically, 1=internal, 2=external, 3 and up are hard disks. However, in the SE and MacII, the drive numbers are assigned by the disk driver and may not fit this mold ( drvNum =1 is always the first floppy drive). volName is the address of a buffer. Upon return, the buffer will contain the volume name, as a length-prefixed, pascal-style string. The buffer should be at least 28 bytes long (to receive the 27-byte maximum volume name). vRefNum is the address of an unsigned short. Upon return it will contain the volume's reference number. freeBytes is the address of a long integer. Upon return it will contain the total free space (in bytes) available on the volume. This will be a multiple of the allocation block size for the volume.
an operating system Error Code . It will be one of: noErr(0) No error nsvErr (-35) No such volume paramErr (-50) Bad drvNum
See GetDrvQHdr for a way to determine the drive numbers of all drives on the system. Use indexing techniques with PBGetVInfo to learn about all mounted volumes. Example #include < Files.h> #include <pascal.h> /* for PtoCstr()
| HVolumeParam volumeParam |
Used in volume-specific functions
| WDParam wdParam |
Used in shared environment calls