2 ** Apple Macintosh Developer Technical Support
4 ** A collection of useful high-level File Manager routines.
6 ** by Jim Luther, Apple Developer Technical Support Emeritus
8 ** File: MoreFilesExtras.h
10 ** Copyright © 1992-1998 Apple Computer, Inc.
11 ** All rights reserved.
13 ** You may incorporate this sample code into your applications without
14 ** restriction, though the sample code has been provided "AS IS" and the
15 ** responsibility for its operation is 100% yours. However, what you are
16 ** not permitted to do is to redistribute the source as "DSC Sample Code"
17 ** after having made changes. If you're going to re-distribute the source,
18 ** we require that you make it clear in the source that the code was
19 ** descended from Apple Sample Code, but that you've made changes.
22 #ifndef __MOREFILESEXTRAS__
23 #define __MOREFILESEXTRAS__
39 /*****************************************************************************/
41 /* Constants and types from Universal Interfaces 3.0.1 Files.h */
43 #if UNIVERSAL_INTERFACES_VERSION < 0x0301
46 volMountNoLoginMsgFlagBit
= 0, /* Input to VolumeMount: If set, the file system */
47 volMountNoLoginMsgFlagMask
= 0x0001, /* should suppresss any log-in message/greeting dialog */
48 volMountExtendedFlagsBit
= 7, /* Input to VolumeMount: If set, the mount info is a */
49 volMountExtendedFlagsMask
= 0x0080 /* AFPXVolMountInfo record for 3.7 AppleShare Client */
52 /* AFPXVolMountInfo is the new AFP volume mount info record, requires the 3.7 AppleShare Client */
54 struct AFPXVolMountInfo
{
55 short length
; /* length of location data (including self) */
56 VolumeType media
; /* type of media */
57 short flags
; /* bits for no messages, no reconnect */
58 SInt8 nbpInterval
; /* NBP Interval parameter (IM2, p.322) */
59 SInt8 nbpCount
; /* NBP Interval parameter (IM2, p.322) */
60 short uamType
; /* User Authentication Method type */
61 short zoneNameOffset
; /* short positive offset from start of struct to Zone Name */
62 short serverNameOffset
; /* offset to pascal Server Name string */
63 short volNameOffset
; /* offset to pascal Volume Name string */
64 short userNameOffset
; /* offset to pascal User Name string */
65 short userPasswordOffset
; /* offset to pascal User Password string */
66 short volPasswordOffset
; /* offset to pascal Volume Password string */
67 short extendedFlags
; /* extended flags word */
68 short uamNameOffset
; /* offset to a pascal UAM name string */
69 short alternateAddressOffset
; /* offset to Alternate Addresses in tagged format */
70 char AFPData
[176]; /* variable length data may follow */
72 typedef struct AFPXVolMountInfo AFPXVolMountInfo
;
73 typedef AFPXVolMountInfo
* AFPXVolMountInfoPtr
;
76 kAFPExtendedFlagsAlternateAddressMask
= 1 /* bit in AFPXVolMountInfo.extendedFlags that means alternateAddressOffset is used*/
80 /* constants for use in AFPTagData.fType field*/
82 kAFPTagTypeIPPort
= 0x02,
83 kAFPTagTypeDDP
= 0x03 /* Currently unused*/
87 /* constants for use in AFPTagData.fLength field*/
88 kAFPTagLengthIP
= 0x06,
89 kAFPTagLengthIPPort
= 0x08,
90 kAFPTagLengthDDP
= 0x06
94 UInt8 fLength
; /* length of this data tag including the fLength field */
96 UInt8 fData
[1]; /* variable length data */
98 typedef struct AFPTagData AFPTagData
;
100 struct AFPAlternateAddress
{
102 UInt8 fAddressList
[1]; /* actually variable length packed set of AFPTagData */
104 typedef struct AFPAlternateAddress AFPAlternateAddress
;
108 /*****************************************************************************/
111 ** Macros to get information out of GetVolParmsInfoBuffer
114 #define isNetworkVolume(volParms) ((volParms).vMServerAdr != 0)
115 #define hasLimitFCBs(volParms) (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
116 #define hasLocalWList(volParms) (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
117 #define hasNoMiniFndr(volParms) (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
118 #define hasNoVNEdit(volParms) (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
119 #define hasNoLclSync(volParms) (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
120 #define hasTrshOffLine(volParms) (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
121 #define hasNoSwitchTo(volParms) (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
122 #define hasNoDeskItems(volParms) (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
123 #define hasNoBootBlks(volParms) (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
124 #define hasAccessCntl(volParms) (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
125 #define hasNoSysDir(volParms) (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
126 #define hasExtFSVol(volParms) (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
127 #define hasOpenDeny(volParms) (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
128 #define hasCopyFile(volParms) (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
129 #define hasMoveRename(volParms) (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
130 #define hasDesktopMgr(volParms) (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
131 #define hasShortName(volParms) (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
132 #define hasFolderLock(volParms) (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
133 #define hasPersonalAccessPrivileges(volParms) \
134 (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
135 #define hasUserGroupList(volParms) (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
136 #define hasCatSearch(volParms) (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
137 #define hasFileIDs(volParms) (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
138 #define hasBTreeMgr(volParms) (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
139 #define hasBlankAccessPrivileges(volParms) \
140 (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
142 /*****************************************************************************/
146 ** Bit masks and macros to get common information out of ioACUser returned
147 ** by PBGetCatInfo (remember to clear ioACUser before calling PBGetCatInfo
148 ** since some file systems don't bother to set this field).
150 ** Use the GetDirAccessRestrictions or FSpGetDirAccessRestrictions
151 ** functions to retrieve the ioACUser access restrictions byte for
154 ** Note: The access restriction byte returned by PBGetCatInfo is the
155 ** 2's complement of the user's privileges byte returned in
156 ** ioACAccess by PBHGetDirAccess.
161 /* bits defined in ioACUser */
162 acUserNoSeeFoldersMask
= 0x01,
163 acUserNoSeeFilesMask
= 0x02,
164 acUserNoMakeChangesMask
= 0x04,
165 acUserNotOwnerMask
= 0x80,
167 /* mask for just the access restriction bits */
168 acUserAccessMask
= 0x07,
170 /* common access privilege settings */
171 acUserFull
= 0x00, /* no access restiction bits on */
172 acUserNone
= acUserAccessMask
, /* all access restiction bits on */
173 acUserDropBox
= acUserNoSeeFoldersMask
+ acUserNoSeeFilesMask
, /* make changes, but not see files or folders */
174 acUserBulletinBoard
= acUserNoMakeChangesMask
/* see files and folders, but not make changes */
177 /* Macros for testing ioACUser bits */
178 #define userIsOwner(ioACUser) \
179 (((ioACUser) & acUserNotOwnerMask) == 0)
180 #define userHasFullAccess(ioACUser) \
181 (((ioACUser) & (acUserAccessMask)) == acUserFull)
182 #define userHasDropBoxAccess(ioACUser) \
183 (((ioACUser) & acUserAccessMask) == acUserDropBox)
184 #define userHasBulletinBoard(ioACUser) \
185 (((ioACUser) & acUserAccessMask) == acUserBulletinBoard)
186 #define userHasNoAccess(ioACUser) \
187 (((ioACUser) & acUserAccessMask) == acUserNone)
189 /*****************************************************************************/
192 ** Deny mode permissions for use with the HOpenAware, HOpenRFAware,
193 ** FSpOpenAware, and FSpOpenRFAware functions.
199 dmNoneDenyRd
= 0x0010,
200 dmNoneDenyWr
= 0x0020,
201 dmNoneDenyRdWr
= 0x0030,
202 dmRd
= 0x0001, /* Single writer, multiple readers; the readers */
204 dmRdDenyWr
= 0x0021, /* Browsing - equivalent to fsRdPerm */
205 dmRdDenyRdWr
= 0x0031,
209 dmWrDenyRdWr
= 0x0032,
210 dmRdWr
= 0x0003, /* Shared access - equivalent to fsRdWrShPerm */
211 dmRdWrDenyRd
= 0x0013,
212 dmRdWrDenyWr
= 0x0023, /* Single writer, multiple readers; the writer */
213 dmRdWrDenyRdWr
= 0x0033 /* Exclusive access - equivalent to fsRdWrPerm */
216 /*****************************************************************************/
218 #if PRAGMA_STRUCT_ALIGN
219 #pragma options align=mac68k
220 #elif PRAGMA_STRUCT_PACKPUSH
221 #pragma pack(push, 2)
222 #elif PRAGMA_STRUCT_PACK
227 ** For those times where you need to use more than one kind of File Manager parameter
228 ** block but don't feel like wasting stack space, here's a parameter block you can reuse.
242 typedef union UniversalFMPB UniversalFMPB
;
243 typedef UniversalFMPB
*UniversalFMPBPtr
, **UniversalFMPBHandle
;
247 ** Used by GetUGEntries to return user or group lists
252 short objType
; /* object type: -1 = group; 0 = user */
253 long objID
; /* the user or group ID */
254 Str31 name
; /* the user or group name */
256 typedef struct UGEntry UGEntry
;
257 typedef UGEntry
*UGEntryPtr
, **UGEntryHandle
;
260 typedef unsigned char Str8
[9];
264 ** I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h
267 struct MyAFPVolMountInfo
269 short length
; /* length of this record */
270 VolumeType media
; /* type of media, always AppleShareMediaType */
271 short flags
; /* 0 = normal mount; set bit 0 to inhibit greeting messages */
272 char nbpInterval
; /* NBP interval parameter; 7 is a good choice */
273 char nbpCount
; /* NBP count parameter; 5 is a good choice */
274 short uamType
; /* User Authentication Method */
275 short zoneNameOffset
; /* offset from start of record to zoneName */
276 short serverNameOffset
; /* offset from start of record to serverName */
277 short volNameOffset
; /* offset from start of record to volName */
278 short userNameOffset
; /* offset from start of record to userName */
279 short userPasswordOffset
; /* offset from start of record to userPassword */
280 short volPasswordOffset
; /* offset from start of record to volPassword */
281 Str32 zoneName
; /* server's AppleTalk zone name */
282 char filler1
; /* to word align volPassword */
283 Str32 serverName
; /* server name */
284 char filler2
; /* to word align volPassword */
285 Str27 volName
; /* volume name */
286 Str31 userName
; /* user name (zero length Pascal string for guest) */
287 Str8 userPassword
; /* user password (zero length Pascal string if no user password) */
288 char filler3
; /* to word align volPassword */
289 Str8 volPassword
; /* volume password (zero length Pascal string if no volume password) */
290 char filler4
; /* to end record on word boundry */
292 typedef struct MyAFPVolMountInfo MyAFPVolMountInfo
;
293 typedef MyAFPVolMountInfo
*MyAFPVolMountInfoPtr
, **MyAFPVolMountInfoHandle
;
295 struct MyAFPXVolMountInfo
297 short length
; /* length of this record */
298 VolumeType media
; /* type of media, always AppleShareMediaType */
299 short flags
; /* bits for no messages, no reconnect, etc */
300 char nbpInterval
; /* NBP interval parameter; 7 is a good choice */
301 char nbpCount
; /* NBP count parameter; 5 is a good choice */
302 short uamType
; /* User Authentication Method */
303 short zoneNameOffset
; /* offset from start of record to zoneName */
304 short serverNameOffset
; /* offset from start of record to serverName */
305 short volNameOffset
; /* offset from start of record to volName */
306 short userNameOffset
; /* offset from start of record to userName */
307 short userPasswordOffset
; /* offset from start of record to userPassword */
308 short volPasswordOffset
; /* offset from start of record to volPassword */
309 short extendedFlags
; /* extended flags word */
310 short uamNameOffset
; /* offset to a pascal UAM name string */
311 short alternateAddressOffset
; /* offset to Alternate Addresses in tagged format */
312 Str32 zoneName
; /* server's AppleTalk zone name */
313 char filler1
; /* to word align volPassword */
314 Str32 serverName
; /* server name */
315 char filler2
; /* to word align volPassword */
316 Str27 volName
; /* volume name */
317 Str31 userName
; /* user name (zero length Pascal string for guest) */
318 Str8 userPassword
; /* user password (zero length Pascal string if no user password) */
319 char filler3
; /* to word align volPassword */
320 Str8 volPassword
; /* volume password (zero length Pascal string if no volume password) */
321 char filler4
; /* to word align uamNameOffset */
322 Str32 uamName
; /* UAM name */
323 char filler5
; /* to word align alternateAddress */
324 char alternateAddress
[kVariableLengthArray
]; /* AFPAlternateAddress */
326 typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo
;
327 typedef MyAFPXVolMountInfo
*MyAFPXVolMountInfoPtr
, **MyAFPXVolMountInfoHandle
;
329 #if PRAGMA_STRUCT_ALIGN
330 #pragma options align=reset
331 #elif PRAGMA_STRUCT_PACKPUSH
333 #elif PRAGMA_STRUCT_PACK
337 /*****************************************************************************/
339 pascal void TruncPString(StringPtr destination
,
340 ConstStr255Param source
,
342 /* ¦ International friendly string truncate routine.
343 The TruncPString function copies up to maxLength characters from
344 the source Pascal string to the destination Pascal string. TruncPString
345 ensures that the truncated string ends on a single-byte character, or on
346 the last byte of a multi-byte character.
348 destination output: destination Pascal string.
349 source input: source Pascal string.
350 maxLength output: The maximum allowable length of the destination
354 /*****************************************************************************/
356 pascal Ptr
GetTempBuffer(long buffReqSize
,
358 /* ¦ Allocate a temporary copy or search buffer.
359 The GetTempBuffer function allocates a temporary buffer for file system
360 operations which is at least 1024 bytes (1K) and a multiple of
363 buffReqSize input: Size you'd like the buffer to be.
364 buffActSize output: Size of buffer allocated.
365 function result output: Pointer to memory allocated or nil if no memory
366 was available. The caller is responsible for
367 disposing of this buffer with DisposePtr.
370 /*****************************************************************************/
372 pascal OSErr
GetVolumeInfoNoName(ConstStr255Param pathname
,
375 /* ¦ Call PBHGetVInfoSync ignoring returned name.
376 GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync
377 in cases where the returned volume name is not needed by the caller.
378 The pathname and vRefNum parameters are not touched, and the pb
379 parameter is initialized by PBHGetVInfoSync except that ioNamePtr in
380 the parameter block is always returned as NULL (since it might point
381 to GetVolumeInfoNoName's local variable tempPathname).
383 I noticed using this code in several places, so here it is once.
384 This reduces the code size of MoreFiles.
386 pathName input: Pointer to a full pathname or nil. If you pass in a
387 partial pathname, it is ignored. A full pathname to a
388 volume must end with a colon character (:).
389 vRefNum input: Volume specification (volume reference number, working
390 directory number, drive number, or 0).
391 pb input: A pointer to HParamBlockRec.
392 output: The parameter block as filled in by PBHGetVInfoSync
393 except that ioNamePtr will always be NULL.
397 nsvErr -35 No such volume
398 paramErr -50 No default volume, or pb was NULL
401 /*****************************************************************************/
403 pascal OSErr
XGetVolumeInfoNoName(ConstStr255Param pathname
,
406 /* ¦ Call PBXGetVolInfoSync ignoring returned name.
407 XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync
408 in cases where the returned volume name is not needed by the caller.
409 The pathname and vRefNum parameters are not touched, and the pb
410 parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in
411 the parameter block is always returned as NULL (since it might point
412 to XGetVolumeInfoNoName's local variable tempPathname).
414 pathName input: Pointer to a full pathname or nil. If you pass in a
415 partial pathname, it is ignored. A full pathname to a
416 volume must end with a colon character (:).
417 vRefNum input: Volume specification (volume reference number, working
418 directory number, drive number, or 0).
419 pb input: A pointer to HParamBlockRec.
420 output: The parameter block as filled in by PBXGetVolInfoSync
421 except that ioNamePtr will always be NULL.
425 nsvErr -35 No such volume
426 paramErr -50 No default volume, or pb was NULL
429 /*****************************************************************************/
431 pascal OSErr
GetCatInfoNoName(short vRefNum
,
433 ConstStr255Param name
,
435 /* ¦ Call PBGetCatInfoSync ignoring returned name.
436 GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync
437 in cases where the returned object is not needed by the caller.
438 The vRefNum, dirID and name parameters are not touched, and the pb
439 parameter is initialized by PBGetCatInfoSync except that ioNamePtr in
440 the parameter block is always returned as NULL (since it might point
441 to GetCatInfoNoName's local variable tempName).
443 I noticed using this code in several places, so here it is once.
444 This reduces the code size of MoreFiles.
446 vRefNum input: Volume specification.
447 dirID input: Directory ID.
448 name input: Pointer to object name, or nil when dirID
449 specifies a directory that's the object.
450 pb input: A pointer to CInfoPBRec.
451 output: The parameter block as filled in by
452 PBGetCatInfoSync except that ioNamePtr will
457 nsvErr -35 No such volume
459 bdNamErr -37 Bad filename
460 fnfErr -43 File not found
461 paramErr -50 No default volume
462 dirNFErr -120 Directory not found or incomplete pathname
463 afpAccessDenied -5000 User does not have the correct access
464 afpObjectTypeErr -5025 Directory not found or incomplete pathname
468 /*****************************************************************************/
470 pascal OSErr
DetermineVRefNum(ConstStr255Param pathname
,
473 /* ¦ Determine the real volume reference number.
474 The DetermineVRefNum function determines the volume reference number of
475 a volume from a pathname, a volume specification, or a combination
477 WARNING: Volume names on the Macintosh are *not* unique -- Multiple
478 mounted volumes can have the same name. For this reason, the use of a
479 volume name or full pathname to identify a specific volume may not
480 produce the results you expect. If more than one volume has the same
481 name and a volume name or full pathname is used, the File Manager
482 currently uses the first volume it finds with a matching name in the
485 pathName input: Pointer to a full pathname or nil. If you pass in a
486 partial pathname, it is ignored. A full pathname to a
487 volume must end with a colon character (:).
488 vRefNum input: Volume specification (volume reference number, working
489 directory number, drive number, or 0).
490 realVRefNum output: The real volume reference number.
494 nsvErr -35 No such volume
495 paramErr -50 No default volume
498 /*****************************************************************************/
500 pascal OSErr
HGetVInfo(short volReference
,
503 unsigned long *freeBytes
,
504 unsigned long *totalBytes
);
505 /* ¦ Get information about a mounted volume.
506 The HGetVInfo function returns the name, volume reference number,
507 available space (in bytes), and total space (in bytes) for the
508 specified volume. You can specify the volume by providing its drive
509 number, volume reference number, or 0 for the default volume.
510 This routine is compatible with volumes up to 4 gigabytes.
512 volReference input: The drive number, volume reference number,
513 or 0 for the default volume.
514 volName input: A pointer to a buffer (minimum Str27) where
515 the volume name is to be returned or must
517 output: The volume name.
518 vRefNum output: The volume reference number.
519 freeBytes output: The number of free bytes on the volume.
520 freeBytes is an unsigned long value.
521 totalBytes output: The total number of bytes on the volume.
522 totalBytes is an unsigned long value.
526 nsvErr -35 No such volume
527 paramErr -50 No default volume
534 /*****************************************************************************/
536 pascal OSErr
XGetVInfo(short volReference
,
539 UnsignedWide
*freeBytes
,
540 UnsignedWide
*totalBytes
);
541 /* ¦ Get extended information about a mounted volume.
542 The XGetVInfo function returns the name, volume reference number,
543 available space (in bytes), and total space (in bytes) for the
544 specified volume. You can specify the volume by providing its drive
545 number, volume reference number, or 0 for the default volume.
546 This routine is compatible with volumes up to 2 terabytes.
548 volReference input: The drive number, volume reference number,
549 or 0 for the default volume.
550 volName input: A pointer to a buffer (minimum Str27) where
551 the volume name is to be returned or must
553 output: The volume name.
554 vRefNum output: The volume reference number.
555 freeBytes output: The number of free bytes on the volume.
556 freeBytes is an UnsignedWide value.
557 totalBytes output: The total number of bytes on the volume.
558 totalBytes is an UnsignedWide value.
562 nsvErr -35 No such volume
563 paramErr -50 No default volume
570 /*****************************************************************************/
572 pascal OSErr
CheckVolLock(ConstStr255Param pathname
,
574 /* ¦ Determine if a volume is locked.
575 The CheckVolLock function determines if a volume is locked - either by
576 hardware or by software. If CheckVolLock returns noErr, then the volume
579 pathName input: Pointer to a full pathname or nil. If you pass in a
580 partial pathname, it is ignored. A full pathname to a
581 volume must end with a colon character (:).
582 vRefNum input: Volume specification (volume reference number, working
583 directory number, drive number, or 0).
586 noErr 0 No error - volume not locked
587 nsvErr -35 No such volume
588 wPrErr -44 Volume locked by hardware
589 vLckdErr -46 Volume locked by software
590 paramErr -50 No default volume
593 /*****************************************************************************/
595 pascal OSErr
GetDriverName(short driverRefNum
,
597 /* ¦ Get a device driver's name.
598 The GetDriverName function returns a device driver's name.
600 driverRefNum input: The driver reference number.
601 driverName output: The driver's name.
605 badUnitErr -21 Bad driver reference number
608 /*****************************************************************************/
610 pascal OSErr
FindDrive(ConstStr255Param pathname
,
612 DrvQElPtr
*driveQElementPtr
);
613 /* ¦ Find a volume's drive queue element in the drive queue.
614 The FindDrive function returns a pointer to a mounted volume's
617 pathName input: Pointer to a full pathname or nil. If you
618 pass in a partial pathname, it is ignored.
619 A full pathname to a volume must end with
620 a colon character (:).
621 vRefNum input: Volume specification (volume reference
622 number, working directory number, drive
624 driveQElementPtr output: Pointer to a volume's drive queue element
625 in the drive queue. DO NOT change the
630 nsvErr -35 No such volume
631 paramErr -50 No default volume
632 nsDrvErr -56 No such drive
635 /*****************************************************************************/
637 pascal OSErr
GetDiskBlocks(ConstStr255Param pathname
,
639 unsigned long *numBlocks
);
640 /* ¦ Return the number of physical disk blocks on a disk drive.
641 The GetDiskBlocks function returns the number of physical disk
642 blocks on a disk drive. NOTE: This is not the same as volume
645 pathName input: Pointer to a full pathname or nil. If you
646 pass in a partial pathname, it is ignored.
647 A full pathname to a volume must end with
648 a colon character (:).
649 vRefNum input: Volume specification (volume reference
650 number, working directory number, drive
652 numBlocks output: The number of physical disk blocks on the disk drive.
656 nsvErr -35 No such volume
657 paramErr -50 No default volume, driver reference
658 number is zero, ReturnFormatList
659 returned zero blocks, DriveStatus
660 returned an unknown value, or
661 driveQElementPtr->qType is unknown
662 nsDrvErr -56 No such drive
663 statusErr Ð18 Driver does not respond to this
665 badUnitErr Ð21 Driver reference number does not
667 unitEmptyErr Ð22 Driver reference number specifies
668 a nil handle in unit table
669 abortErr Ð27 Request aborted by KillIO
670 notOpenErr Ð28 Driver not open
673 /*****************************************************************************/
675 pascal OSErr
GetVolFileSystemID(ConstStr255Param pathname
,
677 short *fileSystemID
);
678 /* ¦ Get a volume's file system ID.
679 The GetVolFileSystemID function returned the file system ID of
680 a mounted volume. The file system ID identifies the file system
681 that handles requests to a particular volume. Here's a partial list
682 of file system ID numbers (only Apple's file systems are listed):
684 ----- -----------------------------------------------------
685 $0000 Macintosh HFS or MFS
686 $0100 ProDOS File System
687 $0101 PowerTalk Mail Enclosures
688 $4147 ISO 9660 File Access (through Foreign File Access)
689 $4242 High Sierra File Access (through Foreign File Access)
690 $464D QuickTake File System (through Foreign File Access)
691 $4953 Macintosh PC Exchange (MS-DOS)
692 $4A48 Audio CD Access (through Foreign File Access)
693 $4D4B Apple Photo Access (through Foreign File Access)
695 See the Technical Note "FL 35 - Determining Which File System
696 Is Active" and the "Guide to the File System Manager" for more
699 pathName input: Pointer to a full pathname or nil. If you pass
700 in a partial pathname, it is ignored. A full
701 pathname to a volume must contain at least
702 one colon character (:) and must not start with
704 vRefNum input: Volume specification (volume reference number,
705 working directory number, drive number, or 0).
706 fileSystemID output: The volume's file system ID.
710 nsvErr -35 No such volume
711 paramErr -50 No default volume, or pb was NULL
714 /*****************************************************************************/
716 pascal OSErr
GetVolState(ConstStr255Param pathname
,
718 Boolean
*volumeOnline
,
719 Boolean
*volumeEjected
,
720 Boolean
*driveEjectable
,
721 Boolean
*driverWantsEject
);
722 /* ¦ Returns a volume's online and eject information.
723 The GetVolState function determines if a volume is online or offline,
724 if an offline volume is ejected, and if the volume's driver is
725 ejectable or wants eject calls.
727 pathName input: Pointer to a full pathname or nil.
728 vRefNum input: Volume specification (volume reference number,
729 working directory number, drive number, or 0).
730 volumeOnline output: True if the volume is online;
731 False if the volume is offline.
732 volumeEjected output: True if the volume is ejected (ejected
733 volumes are always offline); False if the
734 volume is not ejected.
735 driveEjectable output: True if the volume's drive is ejectable;
736 False if the volume's drive is not ejectable.
737 driverWantsEject output: True if the volume's driver wants an Eject
738 request after unmount (even if the drive
739 is not ejectable); False if the volume's
740 driver does not need an eject request.
744 nsvErr -35 No such volume
745 paramErr -50 No default volume, or pb was NULL
748 /*****************************************************************************/
750 pascal OSErr
UnmountAndEject(ConstStr255Param pathname
,
752 /* ¦ Unmount and eject a volume.
753 The UnmountAndEject function unmounts and ejects a volume. The volume
754 is ejected only if it is ejectable and not already ejected.
756 pathName input: Pointer to a full pathname or nil. If you pass in a
757 partial pathname, it is ignored. A full pathname to a
758 volume must end with a colon character (:).
759 vRefNum input: Volume specification (volume reference number, working
760 directory number, drive number, or 0).
764 nsvErr -35 No such volume
766 bdNamErr -37 Bad volume name
767 fBsyErr -47 One or more files are open
768 paramErr -50 No default volume
769 nsDrvErr -56 No such drive
770 extFSErr -58 External file system error - no file
771 system claimed this call.
774 /*****************************************************************************/
776 pascal OSErr
OnLine(FSSpecPtr volumes
,
780 /* ¦ Return the list of volumes currently mounted.
781 The OnLine function returns the list of volumes currently mounted in
782 an array of FSSpec records.
784 A noErr result indicates that the volumes array was filled
785 (actVolCount == reqVolCount) and there may be additional volumes
786 mounted. A nsvErr result indicates that the end of the volume list
787 was found and actVolCount volumes were actually found this time.
789 volumes input: Pointer to array of FSSpec where the volume list
791 reqVolCount input: Maximum number of volumes to return (the number of
792 elements in the volumes array).
793 actVolCount output: The number of volumes actually returned.
794 volIndex input: The current volume index position. Set to 1 to
795 start with the first volume.
796 output: The volume index position to get the next volume.
797 Pass this value the next time you call OnLine to
798 start where you left off.
801 noErr 0 No error, but there are more volumes
803 nsvErr -35 No more volumes to be listed
804 paramErr -50 volIndex was <= 0
807 /*****************************************************************************/
809 pascal OSErr
SetDefault(short newVRefNum
,
813 /* ¦ Set the default volume before making Standard I/O requests.
814 The SetDefault function sets the default volume and directory to the
815 volume specified by newVRefNum and the directory specified by newDirID.
816 The current default volume reference number and directory ID are
817 returned in oldVRefNum and oldDir and must be used to restore the
818 default volume and directory to their previous state *as soon as
819 possible* with the RestoreDefault function. These two functions are
820 designed to be used as a wrapper around Standard I/O routines where
821 the location of the file is implied to be the default volume and
822 directory. In other words, this is how you should use these functions:
824 error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
825 if ( error == noErr )
827 // call the Stdio functions like remove, rename, tmpfile,
828 // fopen, freopen, etc. or non-ANSI extensions like
829 // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
831 error = RestoreDefault(oldVRefNum, oldDirID);
834 By using these functions as a wrapper, you won't need to open a working
835 directory (because SetDefault and RestoreDefault use HSetVol) and you
836 won't have to worry about the effects of using HSetVol (documented in
837 Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
838 Inside Macintosh: Files book in the description of the HSetVol and
839 PBHSetVol functions) because the default volume/directory is restored
840 before giving up control to code that might be affected by HSetVol.
842 newVRefNum input: Volume specification (volume reference number,
843 working directory number, drive number, or 0) of
844 the new default volume.
845 newDirID input: Directory ID of the new default directory.
846 oldVRefNum output: The volume specification to save for use with
848 oldDirID output: The directory ID to save for use with
853 nsvErr -35 No such volume
854 bdNamErr -37 Bad volume name
855 fnfErr -43 Directory not found
856 paramErr -50 No default volume
857 afpAccessDenied -5000 User does not have access to the directory
861 Also see: RestoreDefault
864 /*****************************************************************************/
866 pascal OSErr
RestoreDefault(short oldVRefNum
,
868 /* ¦ Restore the default volume after making Standard C I/O requests.
869 The RestoreDefault function restores the default volume and directory
870 to the volume specified by oldVRefNum and the directory specified by
871 oldDirID. The oldVRefNum and oldDirID parameters were previously
872 obtained from the SetDefault function. These two functions are designed
873 to be used as a wrapper around Standard C I/O routines where the
874 location of the file is implied to be the default volume and directory.
875 In other words, this is how you should use these functions:
877 error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
878 if ( error == noErr )
880 // call the Stdio functions like remove, rename, tmpfile,
881 // fopen, freopen, etc. or non-ANSI extensions like
882 // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
884 error = RestoreDefault(oldVRefNum, oldDirID);
887 By using these functions as a wrapper, you won't need to open a working
888 directory (because SetDefault and RestoreDefault use HSetVol) and you
889 won't have to worry about the effects of using HSetVol (documented in
890 Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
891 Inside Macintosh: Files book in the description of the HSetVol and
892 PBHSetVol functions) because the default volume/directory is restored
893 before giving up control to code that might be affected by HSetVol.
895 oldVRefNum input: The volume specification to restore.
896 oldDirID input: The directory ID to restore.
900 nsvErr -35 No such volume
901 bdNamErr -37 Bad volume name
902 fnfErr -43 Directory not found
903 paramErr -50 No default volume
904 rfNumErr -51 Bad working directory reference number
905 afpAccessDenied -5000 User does not have access to the directory
912 /*****************************************************************************/
914 pascal OSErr
GetDInfo(short vRefNum
,
916 ConstStr255Param name
,
918 /* ¦ Get the finder information for a directory.
919 The GetDInfo function gets the finder information for a directory.
921 vRefNum input: Volume specification.
922 dirID input: Directory ID.
923 name input: Pointer to object name, or nil when dirID
924 specifies a directory that's the object.
925 fndrInfo output: If the object is a directory, then its DInfo.
929 nsvErr -35 No such volume
931 bdNamErr -37 Bad filename
932 fnfErr -43 File not found
933 paramErr -50 No default volume
934 dirNFErr -120 Directory not found or incomplete pathname
935 afpAccessDenied -5000 User does not have the correct access
936 afpObjectTypeErr -5025 Directory not found or incomplete pathname
940 Also see: FSpGetDInfo, FSpGetFInfoCompat
943 /*****************************************************************************/
945 pascal OSErr
FSpGetDInfo(const FSSpec
*spec
,
947 /* ¦ Get the finder information for a directory.
948 The FSpGetDInfo function gets the finder information for a directory.
950 spec input: An FSSpec record specifying the directory.
951 fndrInfo output: If the object is a directory, then its DInfo.
955 nsvErr -35 No such volume
957 bdNamErr -37 Bad filename
958 fnfErr -43 File not found
959 paramErr -50 No default volume
960 dirNFErr -120 Directory not found or incomplete pathname
961 afpAccessDenied -5000 User does not have the correct access
962 afpObjectTypeErr -5025 Directory not found or incomplete pathname
966 Also see: FSpGetFInfoCompat, GetDInfo
969 /*****************************************************************************/
971 pascal OSErr
SetDInfo(short vRefNum
,
973 ConstStr255Param name
,
974 const DInfo
*fndrInfo
);
975 /* ¦ Set the finder information for a directory.
976 The SetDInfo function sets the finder information for a directory.
978 vRefNum input: Volume specification.
979 dirID input: Directory ID.
980 name input: Pointer to object name, or nil when dirID
981 specifies a directory that's the object.
982 fndrInfo input: The DInfo.
986 nsvErr -35 No such volume
988 bdNamErr -37 Bad filename
989 fnfErr -43 File not found
990 fLckdErr -45 File is locked
991 vLckdErr -46 Volume is locked or read-only
992 paramErr -50 No default volume
993 dirNFErr -120 Directory not found or incomplete pathname
994 afpAccessDenied -5000 User does not have the correct access
995 afpObjectTypeErr -5025 Directory not found or incomplete pathname
999 Also see: FSpSetDInfo, FSpSetFInfoCompat
1002 /*****************************************************************************/
1004 pascal OSErr
FSpSetDInfo(const FSSpec
*spec
,
1005 const DInfo
*fndrInfo
);
1006 /* ¦ Set the finder information for a directory.
1007 The FSpSetDInfo function sets the finder information for a directory.
1009 spec input: An FSSpec record specifying the directory.
1010 fndrInfo input: The DInfo.
1014 nsvErr -35 No such volume
1016 bdNamErr -37 Bad filename
1017 fnfErr -43 File not found
1018 fLckdErr -45 File is locked
1019 vLckdErr -46 Volume is locked or read-only
1020 paramErr -50 No default volume
1021 dirNFErr -120 Directory not found or incomplete pathname
1022 afpAccessDenied -5000 User does not have the correct access
1023 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1027 Also see: FSpSetFInfoCompat, SetDInfo
1030 /*****************************************************************************/
1033 #define GetDirID(vRefNum, dirID, name, theDirID, isDirectory) \
1034 GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory)
1037 pascal OSErr
GetDirectoryID(short vRefNum
,
1039 ConstStr255Param name
,
1041 Boolean
*isDirectory
);
1042 /* ¦ Get the directory ID number of the directory specified.
1043 The GetDirectoryID function gets the directory ID number of the
1044 directory specified. If a file is specified, then the parent
1045 directory of the file is returned and isDirectory is false. If
1046 a directory is specified, then that directory's ID number is
1047 returned and isDirectory is true.
1048 WARNING: Volume names on the Macintosh are *not* unique -- Multiple
1049 mounted volumes can have the same name. For this reason, the use of a
1050 volume name or full pathname to identify a specific volume may not
1051 produce the results you expect. If more than one volume has the same
1052 name and a volume name or full pathname is used, the File Manager
1053 currently uses the first volume it finds with a matching name in the
1056 vRefNum input: Volume specification.
1057 dirID input: Directory ID.
1058 name input: Pointer to object name, or nil when dirID
1059 specifies a directory that's the object.
1060 theDirID output: If the object is a file, then its parent directory
1061 ID. If the object is a directory, then its ID.
1062 isDirectory output: True if object is a directory; false if
1067 nsvErr -35 No such volume
1069 bdNamErr -37 Bad filename
1070 fnfErr -43 File not found
1071 paramErr -50 No default volume
1072 dirNFErr -120 Directory not found or incomplete pathname
1073 afpAccessDenied -5000 User does not have the correct access
1074 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1077 /*****************************************************************************/
1080 #define DirIDFromFSSpec(spec, theDirID, isDirectory) \
1081 FSpGetDirectoryID(spec, theDirID, isDirectory)
1084 pascal OSErr
FSpGetDirectoryID(const FSSpec
*spec
,
1086 Boolean
*isDirectory
);
1087 /* ¦ Get the directory ID number of a directory.
1088 The FSpGetDirectoryID function gets the directory ID number of the
1089 directory specified by spec. If spec is to a file, then the parent
1090 directory of the file is returned and isDirectory is false. If
1091 spec is to a directory, then that directory's ID number is
1092 returned and isDirectory is true.
1094 spec input: An FSSpec record specifying the directory.
1095 theDirID output: The directory ID.
1096 isDirectory output: True if object is a directory; false if
1101 nsvErr -35 No such volume
1103 bdNamErr -37 Bad filename
1104 fnfErr -43 File not found
1105 paramErr -50 No default volume
1106 dirNFErr -120 Directory not found or incomplete pathname
1107 afpAccessDenied -5000 User does not have the correct access
1108 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1111 /*****************************************************************************/
1113 pascal OSErr
GetDirName(short vRefNum
,
1116 /* ¦ Get the name of a directory from its directory ID.
1117 The GetDirName function gets the name of a directory from its
1120 vRefNum input: Volume specification.
1121 dirID input: Directory ID.
1122 name output: Points to a Str31 where the directory name is to be
1127 nsvErr -35 No such volume
1129 bdNamErr -37 Bad filename
1130 fnfErr -43 File not found
1131 paramErr -50 No default volume or
1132 name parameter was NULL
1133 dirNFErr -120 Directory not found or incomplete pathname
1134 afpAccessDenied -5000 User does not have the correct access
1135 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1138 /*****************************************************************************/
1140 pascal OSErr
GetIOACUser(short vRefNum
,
1142 ConstStr255Param name
,
1144 /* ¦ Get a directory's access restrictions byte.
1145 GetIOACUser returns a directory's access restrictions byte.
1146 Use the masks and macro defined in MoreFilesExtras to check for
1147 specific access priviledges.
1149 vRefNum input: Volume specification.
1150 dirID input: Directory ID.
1151 name input: Pointer to object name, or nil when dirID
1152 specifies a directory that's the object.
1153 ioACUser output: The access restriction byte
1157 nsvErr -35 No such volume
1159 bdNamErr -37 Bad filename
1160 fnfErr -43 File not found
1161 paramErr -50 No default volume
1162 dirNFErr -120 Directory not found or incomplete pathname
1163 afpAccessDenied -5000 User does not have the correct access
1164 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1167 /*****************************************************************************/
1169 pascal OSErr
FSpGetIOACUser(const FSSpec
*spec
,
1171 /* ¦ Get a directory's access restrictions byte.
1172 FSpGetIOACUser returns a directory's access restrictions byte.
1173 Use the masks and macro defined in MoreFilesExtras to check for
1174 specific access priviledges.
1176 spec input: An FSSpec record specifying the directory.
1177 ioACUser output: The access restriction byte
1181 nsvErr -35 No such volume
1183 bdNamErr -37 Bad filename
1184 fnfErr -43 File not found
1185 paramErr -50 No default volume
1186 dirNFErr -120 Directory not found or incomplete pathname
1187 afpAccessDenied -5000 User does not have the correct access
1188 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1191 /*****************************************************************************/
1193 pascal OSErr
GetParentID(short vRefNum
,
1195 ConstStr255Param name
,
1197 /* ¦ Get the parent directory ID number of the specified object.
1198 The GetParentID function gets the parent directory ID number of the
1201 vRefNum input: Volume specification.
1202 dirID input: Directory ID.
1203 name input: Pointer to object name, or nil when dirID specifies
1204 a directory that's the object.
1205 parID output: The parent directory ID of the specified object.
1209 nsvErr -35 No such volume
1211 bdNamErr -37 Bad filename
1212 fnfErr -43 File not found
1213 paramErr -50 No default volume
1214 dirNFErr -120 Directory not found or incomplete pathname
1215 afpAccessDenied -5000 User does not have the correct access
1216 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1219 /*****************************************************************************/
1221 pascal OSErr
GetFilenameFromPathname(ConstStr255Param pathname
,
1223 /* ¦ Get the object name from the end of a full or partial pathname.
1224 The GetFilenameFromPathname function gets the file (or directory) name
1225 from the end of a full or partial pathname. Returns notAFileErr if the
1226 pathname is nil, the pathname is empty, or the pathname cannot refer to
1227 a filename (with a noErr result, the pathname could still refer to a
1230 pathname input: A full or partial pathname.
1231 filename output: The file (or directory) name.
1235 notAFileErr -1302 The pathname is nil, the pathname
1236 is empty, or the pathname cannot refer
1241 See also: GetObjectLocation.
1244 /*****************************************************************************/
1246 pascal OSErr
GetObjectLocation(short vRefNum
,
1248 ConstStr255Param pathname
,
1252 Boolean
*isDirectory
);
1253 /* ¦ Get a file system object's location.
1254 The GetObjectLocation function gets a file system object's location -
1255 that is, its real volume reference number, real parent directory ID,
1256 and name. While we're at it, determine if the object is a file or directory.
1257 If GetObjectLocation returns fnfErr, then the location information
1258 returned is valid, but it describes an object that doesn't exist.
1259 You can use the location information for another operation, such as
1260 creating a file or directory.
1262 vRefNum input: Volume specification.
1263 dirID input: Directory ID.
1264 pathname input: Pointer to object name, or nil when dirID specifies
1265 a directory that's the object.
1266 realVRefNum output: The real volume reference number.
1267 realParID output: The parent directory ID of the specified object.
1268 realName output: The name of the specified object (the case of the
1269 object name may not be the same as the object's
1270 catalog entry on disk - since the Macintosh file
1271 system is not case sensitive, it shouldn't matter).
1272 isDirectory output: True if object is a directory; false if object
1277 nsvErr -35 No such volume
1279 bdNamErr -37 Bad filename
1280 fnfErr -43 File not found
1281 paramErr -50 No default volume
1282 dirNFErr -120 Directory not found or incomplete pathname
1283 notAFileErr -1302 The pathname is nil, the pathname
1284 is empty, or the pathname cannot refer
1286 afpAccessDenied -5000 User does not have the correct access
1287 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1291 See also: FSMakeFSSpecCompat
1294 /*****************************************************************************/
1296 pascal OSErr
GetDirItems(short vRefNum
,
1298 ConstStr255Param name
,
1300 Boolean getDirectories
,
1303 short *actItemCount
,
1305 /* ¦ Return a list of items in a directory.
1306 The GetDirItems function returns a list of items in the specified
1307 directory in an array of FSSpec records. File, subdirectories, or
1308 both can be returned in the list.
1310 A noErr result indicates that the items array was filled
1311 (actItemCount == reqItemCount) and there may be additional items
1312 left in the directory. A fnfErr result indicates that the end of
1313 the directory list was found and actItemCount items were actually
1316 vRefNum input: Volume specification.
1317 dirID input: Directory ID.
1318 name input: Pointer to object name, or nil when dirID
1319 specifies a directory that's the object.
1320 getFiles input: Pass true to have files added to the items list.
1321 getDirectories input: Pass true to have directories added to the
1323 items input: Pointer to array of FSSpec where the item list
1325 reqItemCount input: Maximum number of items to return (the number
1326 of elements in the items array).
1327 actItemCount output: The number of items actually returned.
1328 itemIndex input: The current item index position. Set to 1 to
1329 start with the first item in the directory.
1330 output: The item index position to get the next item.
1331 Pass this value the next time you call
1332 GetDirItems to start where you left off.
1335 noErr 0 No error, but there are more items
1337 nsvErr -35 No such volume
1339 bdNamErr -37 Bad filename
1340 fnfErr -43 File not found, there are no more items
1342 paramErr -50 No default volume or itemIndex was <= 0
1343 dirNFErr -120 Directory not found or incomplete pathname
1344 afpAccessDenied -5000 User does not have the correct access
1345 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1348 /*****************************************************************************/
1350 pascal OSErr
DeleteDirectoryContents(short vRefNum
,
1352 ConstStr255Param name
);
1353 /* ¦ Delete the contents of a directory.
1354 The DeleteDirectoryContents function deletes the contents of a directory.
1355 All files and subdirectories in the specified directory are deleted.
1356 If a locked file or directory is encountered, it is unlocked and then
1357 deleted. If any unexpected errors are encountered,
1358 DeleteDirectoryContents quits and returns to the caller.
1360 vRefNum input: Volume specification.
1361 dirID input: Directory ID.
1362 name input: Pointer to directory name, or nil when dirID specifies
1363 a directory that's the object.
1367 nsvErr -35 No such volume
1369 bdNamErr -37 Bad filename
1370 fnfErr -43 File not found
1371 wPrErr -44 Hardware volume lock
1372 fLckdErr -45 File is locked
1373 vLckdErr -46 Software volume lock
1374 fBsyErr -47 File busy, directory not empty, or working directory control block open
1375 paramErr -50 No default volume
1376 dirNFErr -120 Directory not found or incomplete pathname
1377 afpAccessDenied -5000 User does not have the correct access
1378 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1382 Also see: DeleteDirectory
1385 /*****************************************************************************/
1387 pascal OSErr
DeleteDirectory(short vRefNum
,
1389 ConstStr255Param name
);
1390 /* ¦ Delete a directory and its contents.
1391 The DeleteDirectory function deletes a directory and its contents.
1392 All files and subdirectories in the specified directory are deleted.
1393 If a locked file or directory is encountered, it is unlocked and then
1394 deleted. After deleting the directories contents, the directory is
1395 deleted. If any unexpected errors are encountered, DeleteDirectory
1396 quits and returns to the caller.
1398 vRefNum input: Volume specification.
1399 dirID input: Directory ID.
1400 name input: Pointer to directory name, or nil when dirID specifies
1401 a directory that's the object.
1405 nsvErr -35 No such volume
1407 bdNamErr -37 Bad filename
1408 fnfErr -43 File not found
1409 wPrErr -44 Hardware volume lock
1410 fLckdErr -45 File is locked
1411 vLckdErr -46 Software volume lock
1412 fBsyErr -47 File busy, directory not empty, or working directory control block open
1413 paramErr -50 No default volume
1414 dirNFErr -120 Directory not found or incomplete pathname
1415 afpAccessDenied -5000 User does not have the correct access
1416 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1420 Also see: DeleteDirectoryContents
1423 /*****************************************************************************/
1425 pascal OSErr
CheckObjectLock(short vRefNum
,
1427 ConstStr255Param name
);
1428 /* ¦ Determine if a file or directory is locked.
1429 The CheckObjectLock function determines if a file or directory is locked.
1430 If CheckObjectLock returns noErr, then the file or directory
1431 is not locked. If CheckObjectLock returns fLckdErr, the it is locked.
1433 vRefNum input: Volume specification.
1434 dirID input: Directory ID.
1435 name input: Pointer to object name, or nil when dirID specifies
1436 a directory that's the object.
1440 nsvErr -35 No such volume
1442 bdNamErr -37 Bad filename
1443 fnfErr -43 File not found
1444 fLckdErr -45 File is locked
1445 paramErr -50 No default volume
1446 dirNFErr -120 Directory not found or incomplete pathname
1447 afpAccessDenied -5000 User does not have the correct access
1448 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1452 Also see: FSpCheckObjectLock
1455 /*****************************************************************************/
1457 pascal OSErr
FSpCheckObjectLock(const FSSpec
*spec
);
1458 /* ¦ Determine if a file or directory is locked.
1459 The FSpCheckObjectLock function determines if a file or directory is locked.
1460 If FSpCheckObjectLock returns noErr, then the file or directory
1463 spec input: An FSSpec record specifying the object.
1467 nsvErr -35 No such volume
1469 bdNamErr -37 Bad filename
1470 fnfErr -43 File not found
1471 fLckdErr -45 File is locked
1472 paramErr -50 No default volume
1473 dirNFErr -120 Directory not found or incomplete pathname
1474 afpAccessDenied -5000 User does not have the correct access
1475 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1479 Also see: CheckObjectLock
1482 /*****************************************************************************/
1484 pascal OSErr
GetFileSize(short vRefNum
,
1486 ConstStr255Param fileName
,
1489 /* ¦ Get the logical sizes of a file's forks.
1490 The GetFileSize function returns the logical size of a file's
1491 data and resource fork.
1493 vRefNum input: Volume specification.
1494 dirID input: Directory ID.
1495 name input: The name of the file.
1496 dataSize output: The number of bytes in the file's data fork.
1497 rsrcSize output: The number of bytes in the file's resource fork.
1501 nsvErr -35 No such volume
1503 bdNamErr -37 Bad filename
1504 fnfErr -43 File not found
1505 paramErr -50 No default volume
1506 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
1507 afpAccessDenied -5000 User does not have the correct access
1508 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1512 See also: FSpGetFileSize
1515 /*****************************************************************************/
1517 pascal OSErr
FSpGetFileSize(const FSSpec
*spec
,
1520 /* ¦ Get the logical sizes of a file's forks.
1521 The FSpGetFileSize function returns the logical size of a file's
1522 data and resource fork.
1524 spec input: An FSSpec record specifying the file.
1525 dataSize output: The number of bytes in the file's data fork.
1526 rsrcSize output: The number of bytes in the file's resource fork.
1530 nsvErr -35 No such volume
1532 bdNamErr -37 Bad filename
1533 fnfErr -43 File not found
1534 paramErr -50 No default volume
1535 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
1536 afpAccessDenied -5000 User does not have the correct access
1537 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1541 See also: GetFileSize
1544 /*****************************************************************************/
1546 pascal OSErr
BumpDate(short vRefNum
,
1548 ConstStr255Param name
);
1549 /* ¦ Update the modification date of a file or directory.
1550 The BumpDate function changes the modification date of a file or
1551 directory to the current date/time. If the modification date is already
1552 equal to the current date/time, then add one second to the
1555 vRefNum input: Volume specification.
1556 dirID input: Directory ID.
1557 name input: Pointer to object name, or nil when dirID specifies
1558 a directory that's the object.
1562 nsvErr -35 No such volume
1564 bdNamErr -37 Bad filename
1565 fnfErr -43 File not found
1566 fLckdErr -45 File is locked
1567 vLckdErr -46 Volume is locked or read-only
1568 paramErr -50 No default volume
1569 dirNFErr -120 Directory not found or incomplete pathname
1570 afpAccessDenied -5000 User does not have the correct access
1571 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1575 See also: FSpBumpDate
1578 /*****************************************************************************/
1580 pascal OSErr
FSpBumpDate(const FSSpec
*spec
);
1581 /* ¦ Update the modification date of a file or directory.
1582 The FSpBumpDate function changes the modification date of a file or
1583 directory to the current date/time. If the modification date is already
1584 equal to the current date/time, then add one second to the
1587 spec input: An FSSpec record specifying the object.
1591 nsvErr -35 No such volume
1593 bdNamErr -37 Bad filename
1594 fnfErr -43 File not found
1595 fLckdErr -45 File is locked
1596 vLckdErr -46 Volume is locked or read-only
1597 paramErr -50 No default volume
1598 dirNFErr -120 Directory not found or incomplete pathname
1599 afpAccessDenied -5000 User does not have the correct access
1600 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1607 /*****************************************************************************/
1609 pascal OSErr
ChangeCreatorType(short vRefNum
,
1611 ConstStr255Param name
,
1614 /* ¦ Change the creator or file type of a file.
1615 The ChangeCreatorType function changes the creator or file type of a file.
1617 vRefNum input: Volume specification.
1618 dirID input: Directory ID.
1619 name input: The name of the file.
1620 creator input: The new creator type or 0x00000000 to leave
1621 the creator type alone.
1622 fileType input: The new file type or 0x00000000 to leave the
1627 nsvErr -35 No such volume
1629 bdNamErr -37 Bad filename
1630 fnfErr -43 File not found
1631 fLckdErr -45 File is locked
1632 vLckdErr -46 Volume is locked or read-only
1633 paramErr -50 No default volume
1634 dirNFErr -120 Directory not found or incomplete pathname
1635 notAFileErr -1302 Name was not a file
1636 afpAccessDenied -5000 User does not have the correct access
1637 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1641 See also: FSpChangeCreatorType
1644 /*****************************************************************************/
1646 pascal OSErr
FSpChangeCreatorType(const FSSpec
*spec
,
1649 /* ¦ Change the creator or file type of a file.
1650 The FSpChangeCreatorType function changes the creator or file type of a file.
1652 spec input: An FSSpec record specifying the file.
1653 creator input: The new creator type or 0x00000000 to leave
1654 the creator type alone.
1655 fileType input: The new file type or 0x00000000 to leave the
1660 nsvErr -35 No such volume
1662 bdNamErr -37 Bad filename
1663 fnfErr -43 File not found
1664 fLckdErr -45 File is locked
1665 vLckdErr -46 Volume is locked or read-only
1666 paramErr -50 No default volume
1667 dirNFErr -120 Directory not found or incomplete pathname
1668 notAFileErr -1302 Name was not a file
1669 afpAccessDenied -5000 User does not have the correct access
1670 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1674 See also: ChangeCreatorType
1677 /*****************************************************************************/
1679 pascal OSErr
ChangeFDFlags(short vRefNum
,
1681 ConstStr255Param name
,
1683 unsigned short flagBits
);
1684 /* ¦ Set or clear Finder Flag bits.
1685 The ChangeFDFlags function sets or clears Finder Flag bits in the
1686 fdFlags field of a file or directory's FInfo record.
1688 vRefNum input: Volume specification.
1689 dirID input: Directory ID.
1690 name input: Pointer to object name, or nil when dirID specifies
1691 a directory that's the object.
1692 setBits input: If true, then set the bits specified in flagBits.
1693 If false, then clear the bits specified in flagBits.
1694 flagBits input: The flagBits parameter specifies which Finder Flag
1695 bits to set or clear. If a bit in flagBits is set,
1696 then the same bit in fdFlags is either set or
1697 cleared depending on the state of the setBits
1702 nsvErr -35 No such volume
1704 bdNamErr -37 Bad filename
1705 fnfErr -43 File not found
1706 fLckdErr -45 File is locked
1707 vLckdErr -46 Volume is locked or read-only
1708 paramErr -50 No default volume
1709 dirNFErr -120 Directory not found or incomplete pathname
1710 afpAccessDenied -5000 User does not have the correct access
1711 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1715 See also: FSpChangeFDFlags
1718 /*****************************************************************************/
1720 pascal OSErr
FSpChangeFDFlags(const FSSpec
*spec
,
1722 unsigned short flagBits
);
1723 /* ¦ Set or clear Finder Flag bits.
1724 The FSpChangeFDFlags function sets or clears Finder Flag bits in the
1725 fdFlags field of a file or directory's FInfo record.
1727 spec input: An FSSpec record specifying the object.
1728 setBits input: If true, then set the bits specified in flagBits.
1729 If false, then clear the bits specified in flagBits.
1730 flagBits input: The flagBits parameter specifies which Finder Flag
1731 bits to set or clear. If a bit in flagBits is set,
1732 then the same bit in fdFlags is either set or
1733 cleared depending on the state of the setBits
1738 nsvErr -35 No such volume
1740 bdNamErr -37 Bad filename
1741 fnfErr -43 File not found
1742 fLckdErr -45 File is locked
1743 vLckdErr -46 Volume is locked or read-only
1744 paramErr -50 No default volume
1745 dirNFErr -120 Directory not found or incomplete pathname
1746 afpAccessDenied -5000 User does not have the correct access
1747 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1751 See also: ChangeFDFlags
1754 /*****************************************************************************/
1756 pascal OSErr
SetIsInvisible(short vRefNum
,
1758 ConstStr255Param name
);
1759 /* ¦ Set the invisible Finder Flag bit.
1760 The SetIsInvisible function sets the invisible bit in the fdFlags
1761 word of the specified file or directory's finder information.
1763 vRefNum input: Volume specification.
1764 dirID input: Directory ID.
1765 name input: Pointer to object name, or nil when dirID specifies
1766 a directory that's the object.
1770 nsvErr -35 No such volume
1772 bdNamErr -37 Bad filename
1773 fnfErr -43 File not found
1774 fLckdErr -45 File is locked
1775 vLckdErr -46 Volume is locked or read-only
1776 paramErr -50 No default volume
1777 dirNFErr -120 Directory not found or incomplete pathname
1778 afpAccessDenied -5000 User does not have the correct access
1779 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1783 See also: FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
1786 /*****************************************************************************/
1788 pascal OSErr
FSpSetIsInvisible(const FSSpec
*spec
);
1789 /* ¦ Set the invisible Finder Flag bit.
1790 The FSpSetIsInvisible function sets the invisible bit in the fdFlags
1791 word of the specified file or directory's finder information.
1793 spec input: An FSSpec record specifying the object.
1797 nsvErr -35 No such volume
1799 bdNamErr -37 Bad filename
1800 fnfErr -43 File not found
1801 fLckdErr -45 File is locked
1802 vLckdErr -46 Volume is locked or read-only
1803 paramErr -50 No default volume
1804 dirNFErr -120 Directory not found or incomplete pathname
1805 afpAccessDenied -5000 User does not have the correct access
1806 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1810 See also: SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
1813 /*****************************************************************************/
1815 pascal OSErr
ClearIsInvisible(short vRefNum
,
1817 ConstStr255Param name
);
1818 /* ¦ Clear the invisible Finder Flag bit.
1819 The ClearIsInvisible function clears the invisible bit in the fdFlags
1820 word of the specified file or directory's finder information.
1822 vRefNum input: Volume specification.
1823 dirID input: Directory ID.
1824 name input: Pointer to object name, or nil when dirID specifies
1825 a directory that's the object.
1829 nsvErr -35 No such volume
1831 bdNamErr -37 Bad filename
1832 fnfErr -43 File not found
1833 fLckdErr -45 File is locked
1834 vLckdErr -46 Volume is locked or read-only
1835 paramErr -50 No default volume
1836 dirNFErr -120 Directory not found or incomplete pathname
1837 afpAccessDenied -5000 User does not have the correct access
1838 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1842 See also: SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
1845 /*****************************************************************************/
1847 pascal OSErr
FSpClearIsInvisible(const FSSpec
*spec
);
1848 /* ¦ Clear the invisible Finder Flag bit.
1849 The FSpClearIsInvisible function clears the invisible bit in the fdFlags
1850 word of the specified file or directory's finder information.
1852 spec input: An FSSpec record specifying the object.
1856 nsvErr -35 No such volume
1858 bdNamErr -37 Bad filename
1859 fnfErr -43 File not found
1860 fLckdErr -45 File is locked
1861 vLckdErr -46 Volume is locked or read-only
1862 paramErr -50 No default volume
1863 dirNFErr -120 Directory not found or incomplete pathname
1864 afpAccessDenied -5000 User does not have the correct access
1865 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1869 See also: SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
1872 /*****************************************************************************/
1874 pascal OSErr
SetNameLocked(short vRefNum
,
1876 ConstStr255Param name
);
1877 /* ¦ Set the nameLocked Finder Flag bit.
1878 The SetNameLocked function sets the nameLocked bit in the fdFlags word
1879 of the specified file or directory's finder information.
1881 vRefNum input: Volume specification.
1882 dirID input: Directory ID.
1883 name input: Pointer to object name, or nil when dirID specifies
1884 a directory that's the object.
1888 nsvErr -35 No such volume
1890 bdNamErr -37 Bad filename
1891 fnfErr -43 File not found
1892 fLckdErr -45 File is locked
1893 vLckdErr -46 Volume is locked or read-only
1894 paramErr -50 No default volume
1895 dirNFErr -120 Directory not found or incomplete pathname
1896 afpAccessDenied -5000 User does not have the correct access
1897 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1901 See also: FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
1904 /*****************************************************************************/
1906 pascal OSErr
FSpSetNameLocked(const FSSpec
*spec
);
1907 /* ¦ Set the nameLocked Finder Flag bit.
1908 The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
1909 of the specified file or directory's finder information.
1911 spec input: An FSSpec record specifying the object.
1915 nsvErr -35 No such volume
1917 bdNamErr -37 Bad filename
1918 fnfErr -43 File not found
1919 fLckdErr -45 File is locked
1920 vLckdErr -46 Volume is locked or read-only
1921 paramErr -50 No default volume
1922 dirNFErr -120 Directory not found or incomplete pathname
1923 afpAccessDenied -5000 User does not have the correct access
1924 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1928 See also: SetNameLocked, ClearNameLocked, FSpClearNameLocked
1931 /*****************************************************************************/
1933 pascal OSErr
ClearNameLocked(short vRefNum
,
1935 ConstStr255Param name
);
1936 /* ¦ Clear the nameLocked Finder Flag bit.
1937 The ClearNameLocked function clears the nameLocked bit in the fdFlags
1938 word of the specified file or directory's finder information.
1940 vRefNum input: Volume specification.
1941 dirID input: Directory ID.
1942 name input: Pointer to object name, or nil when dirID specifies
1943 a directory that's the object.
1947 nsvErr -35 No such volume
1949 bdNamErr -37 Bad filename
1950 fnfErr -43 File not found
1951 fLckdErr -45 File is locked
1952 vLckdErr -46 Volume is locked or read-only
1953 paramErr -50 No default volume
1954 dirNFErr -120 Directory not found or incomplete pathname
1955 afpAccessDenied -5000 User does not have the correct access
1956 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1960 See also: SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
1963 /*****************************************************************************/
1965 pascal OSErr
FSpClearNameLocked(const FSSpec
*spec
);
1966 /* ¦ Clear the nameLocked Finder Flag bit.
1967 The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
1968 word of the specified file or directory's finder information.
1970 spec input: An FSSpec record specifying the object.
1974 nsvErr -35 No such volume
1976 bdNamErr -37 Bad filename
1977 fnfErr -43 File not found
1978 fLckdErr -45 File is locked
1979 vLckdErr -46 Volume is locked or read-only
1980 paramErr -50 No default volume
1981 dirNFErr -120 Directory not found or incomplete pathname
1982 afpAccessDenied -5000 User does not have the correct access
1983 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1987 See also: SetNameLocked, FSpSetNameLocked, ClearNameLocked
1990 /*****************************************************************************/
1992 pascal OSErr
SetIsStationery(short vRefNum
,
1994 ConstStr255Param name
);
1995 /* ¦ Set the isStationery Finder Flag bit.
1996 The SetIsStationery function sets the isStationery bit in the
1997 fdFlags word of the specified file or directory's finder information.
1999 vRefNum input: Volume specification.
2000 dirID input: Directory ID.
2001 name input: Pointer to object name, or nil when dirID specifies
2002 a directory that's the object.
2006 nsvErr -35 No such volume
2008 bdNamErr -37 Bad filename
2009 fnfErr -43 File not found
2010 fLckdErr -45 File is locked
2011 vLckdErr -46 Volume is locked or read-only
2012 paramErr -50 No default volume
2013 dirNFErr -120 Directory not found or incomplete pathname
2014 afpAccessDenied -5000 User does not have the correct access
2015 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2019 See also: FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
2022 /*****************************************************************************/
2024 pascal OSErr
FSpSetIsStationery(const FSSpec
*spec
);
2025 /* ¦ Set the isStationery Finder Flag bit.
2026 The FSpSetIsStationery function sets the isStationery bit in the
2027 fdFlags word of the specified file or directory's finder information.
2029 spec input: An FSSpec record specifying the object.
2033 nsvErr -35 No such volume
2035 bdNamErr -37 Bad filename
2036 fnfErr -43 File not found
2037 fLckdErr -45 File is locked
2038 vLckdErr -46 Volume is locked or read-only
2039 paramErr -50 No default volume
2040 dirNFErr -120 Directory not found or incomplete pathname
2041 afpAccessDenied -5000 User does not have the correct access
2042 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2046 See also: SetIsStationery, ClearIsStationery, FSpClearIsStationery
2049 /*****************************************************************************/
2051 pascal OSErr
ClearIsStationery(short vRefNum
,
2053 ConstStr255Param name
);
2054 /* ¦ Clear the isStationery Finder Flag bit.
2055 The ClearIsStationery function clears the isStationery bit in the
2056 fdFlags word of the specified file or directory's finder information.
2058 vRefNum input: Volume specification.
2059 dirID input: Directory ID.
2060 name input: Pointer to object name, or nil when dirID specifies
2061 a directory that's the object.
2065 nsvErr -35 No such volume
2067 bdNamErr -37 Bad filename
2068 fnfErr -43 File not found
2069 fLckdErr -45 File is locked
2070 vLckdErr -46 Volume is locked or read-only
2071 paramErr -50 No default volume
2072 dirNFErr -120 Directory not found or incomplete pathname
2073 afpAccessDenied -5000 User does not have the correct access
2074 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2078 See also: SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
2081 /*****************************************************************************/
2083 pascal OSErr
FSpClearIsStationery(const FSSpec
*spec
);
2084 /* ¦ Clear the isStationery Finder Flag bit.
2085 The FSpClearIsStationery function clears the isStationery bit in the
2086 fdFlags word of the specified file or directory's finder information.
2088 spec input: An FSSpec record specifying the object.
2092 nsvErr -35 No such volume
2094 bdNamErr -37 Bad filename
2095 fnfErr -43 File not found
2096 fLckdErr -45 File is locked
2097 vLckdErr -46 Volume is locked or read-only
2098 paramErr -50 No default volume
2099 dirNFErr -120 Directory not found or incomplete pathname
2100 afpAccessDenied -5000 User does not have the correct access
2101 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2105 See also: SetIsStationery, FSpSetIsStationery, ClearIsStationery
2108 /*****************************************************************************/
2110 pascal OSErr
SetHasCustomIcon(short vRefNum
,
2112 ConstStr255Param name
);
2113 /* ¦ Set the hasCustomIcon Finder Flag bit.
2114 The SetHasCustomIcon function sets the hasCustomIcon bit in the
2115 fdFlags word of the specified file or directory's finder information.
2117 vRefNum input: Volume specification.
2118 dirID input: Directory ID.
2119 name input: Pointer to object name, or nil when dirID specifies
2120 a directory that's the object.
2124 nsvErr -35 No such volume
2126 bdNamErr -37 Bad filename
2127 fnfErr -43 File not found
2128 fLckdErr -45 File is locked
2129 vLckdErr -46 Volume is locked or read-only
2130 paramErr -50 No default volume
2131 dirNFErr -120 Directory not found or incomplete pathname
2132 afpAccessDenied -5000 User does not have the correct access
2133 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2137 See also: FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
2140 /*****************************************************************************/
2142 pascal OSErr
FSpSetHasCustomIcon(const FSSpec
*spec
);
2143 /* ¦ Set the hasCustomIcon Finder Flag bit.
2144 The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
2145 fdFlags word of the specified file or directory's finder information.
2147 spec input: An FSSpec record specifying the object.
2151 nsvErr -35 No such volume
2153 bdNamErr -37 Bad filename
2154 fnfErr -43 File not found
2155 fLckdErr -45 File is locked
2156 vLckdErr -46 Volume is locked or read-only
2157 paramErr -50 No default volume
2158 dirNFErr -120 Directory not found or incomplete pathname
2159 afpAccessDenied -5000 User does not have the correct access
2160 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2164 See also: SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
2167 /*****************************************************************************/
2169 pascal OSErr
ClearHasCustomIcon(short vRefNum
,
2171 ConstStr255Param name
);
2172 /* ¦ Clear the hasCustomIcon Finder Flag bit.
2173 The ClearHasCustomIcon function clears the hasCustomIcon bit in the
2174 fdFlags word of the specified file or directory's finder information.
2176 vRefNum input: Volume specification.
2177 dirID input: Directory ID.
2178 name input: Pointer to object name, or nil when dirID specifies
2179 a directory that's the object.
2183 nsvErr -35 No such volume
2185 bdNamErr -37 Bad filename
2186 fnfErr -43 File not found
2187 fLckdErr -45 File is locked
2188 vLckdErr -46 Volume is locked or read-only
2189 paramErr -50 No default volume
2190 dirNFErr -120 Directory not found or incomplete pathname
2191 afpAccessDenied -5000 User does not have the correct access
2192 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2196 See also: SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
2199 /*****************************************************************************/
2201 pascal OSErr
FSpClearHasCustomIcon(const FSSpec
*spec
);
2202 /* ¦ Clear the hasCustomIcon Finder Flag bit.
2203 The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
2204 fdFlags word of the specified file or directory's finder information.
2206 spec input: An FSSpec record specifying the object.
2210 nsvErr -35 No such volume
2212 bdNamErr -37 Bad filename
2213 fnfErr -43 File not found
2214 fLckdErr -45 File is locked
2215 vLckdErr -46 Volume is locked or read-only
2216 paramErr -50 No default volume
2217 dirNFErr -120 Directory not found or incomplete pathname
2218 afpAccessDenied -5000 User does not have the correct access
2219 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2223 See also: SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
2226 /*****************************************************************************/
2228 pascal OSErr
ClearHasBeenInited(short vRefNum
,
2230 ConstStr255Param name
);
2231 /* ¦ Clear the hasBeenInited Finder Flag bit.
2232 The ClearHasBeenInited function clears the hasBeenInited bit in the
2233 fdFlags word of the specified file or directory's finder information.
2235 vRefNum input: Volume specification.
2236 dirID input: Directory ID.
2237 name input: Pointer to object name, or nil when dirID specifies
2238 a directory that's the object.
2242 nsvErr -35 No such volume
2244 bdNamErr -37 Bad filename
2245 fnfErr -43 File not found
2246 fLckdErr -45 File is locked
2247 vLckdErr -46 Volume is locked or read-only
2248 paramErr -50 No default volume
2249 dirNFErr -120 Directory not found or incomplete pathname
2250 afpAccessDenied -5000 User does not have the correct access
2251 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2255 See also: FSpClearHasBeenInited
2258 /*****************************************************************************/
2260 pascal OSErr
FSpClearHasBeenInited(const FSSpec
*spec
);
2261 /* ¦ Clear the hasBeenInited Finder Flag bit.
2262 The FSpClearHasBeenInited function clears the hasBeenInited bit in the
2263 fdFlags word of the specified file or directory's finder information.
2265 spec input: An FSSpec record specifying the object.
2269 nsvErr -35 No such volume
2271 bdNamErr -37 Bad filename
2272 fnfErr -43 File not found
2273 fLckdErr -45 File is locked
2274 vLckdErr -46 Volume is locked or read-only
2275 paramErr -50 No default volume
2276 dirNFErr -120 Directory not found or incomplete pathname
2277 afpAccessDenied -5000 User does not have the correct access
2278 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2282 See also: ClearHasBeenInited
2285 /*****************************************************************************/
2287 pascal OSErr
CopyFileMgrAttributes(short srcVRefNum
,
2289 ConstStr255Param srcName
,
2292 ConstStr255Param dstName
,
2293 Boolean copyLockBit
);
2294 /* ¦ Copy all File Manager attributes from the source to the destination.
2295 The CopyFileMgrAttributes function copies all File Manager attributes
2296 from the source file or directory to the destination file or directory.
2297 If copyLockBit is true, then set the locked state of the destination
2298 to match the source.
2300 srcVRefNum input: Source volume specification.
2301 srcDirID input: Source directory ID.
2302 srcName input: Pointer to source object name, or nil when
2303 srcDirID specifies a directory that's the object.
2304 dstVRefNum input: Destination volume specification.
2305 dstDirID input: Destination directory ID.
2306 dstName input: Pointer to destination object name, or nil when
2307 dstDirID specifies a directory that's the object.
2308 copyLockBit input: If true, set the locked state of the destination
2309 to match the source.
2313 nsvErr -35 No such volume
2315 bdNamErr -37 Bad filename
2316 fnfErr -43 File not found
2317 fLckdErr -45 File is locked
2318 vLckdErr -46 Volume is locked or read-only
2319 paramErr -50 No default volume
2320 dirNFErr -120 Directory not found or incomplete pathname
2321 afpAccessDenied -5000 User does not have the correct access
2322 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2326 See also: FSpCopyFileMgrAttributes
2329 /*****************************************************************************/
2331 pascal OSErr
FSpCopyFileMgrAttributes(const FSSpec
*srcSpec
,
2332 const FSSpec
*dstSpec
,
2333 Boolean copyLockBit
);
2334 /* ¦ Copy all File Manager attributes from the source to the destination.
2335 The FSpCopyFileMgrAttributes function copies all File Manager attributes
2336 from the source file or directory to the destination file or directory.
2337 If copyLockBit is true, then set the locked state of the destination
2338 to match the source.
2340 srcSpec input: An FSSpec record specifying the source object.
2341 dstSpec input: An FSSpec record specifying the destination object.
2342 copyLockBit input: If true, set the locked state of the destination
2343 to match the source.
2347 nsvErr -35 No such volume
2349 bdNamErr -37 Bad filename
2350 fnfErr -43 File not found
2351 fLckdErr -45 File is locked
2352 vLckdErr -46 Volume is locked or read-only
2353 paramErr -50 No default volume
2354 dirNFErr -120 Directory not found or incomplete pathname
2355 afpAccessDenied -5000 User does not have the correct access
2356 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2360 See also: CopyFileMgrAttributes
2363 /*****************************************************************************/
2365 pascal OSErr
HOpenAware(short vRefNum
,
2367 ConstStr255Param fileName
,
2370 /* ¦ Open the data fork of a file using deny mode permissions.
2371 The HOpenAware function opens the data fork of a file using deny mode
2372 permissions instead the normal File Manager permissions. If OpenDeny
2373 is not available, then HOpenAware translates the deny modes to the
2374 closest File Manager permissions and tries to open the file with
2375 OpenDF first, and then Open if OpenDF isn't available. By using
2376 HOpenAware with deny mode permissions, a program can be "AppleShare
2377 aware" and fall back on the standard File Manager open calls
2380 vRefNum input: Volume specification.
2381 dirID input: Directory ID.
2382 fileName input: The name of the file.
2383 denyModes input: The deny modes access under which to open the file.
2384 refNum output: The file reference number of the opened file.
2388 nsvErr -35 No such volume
2389 tmfoErr -42 Too many files open
2390 fnfErr -43 File not found
2391 wPrErr -44 Volume locked by hardware
2392 fLckdErr -45 File is locked
2393 vLckdErr -46 Volume is locked or read-only
2394 opWrErr -49 File already open for writing
2395 paramErr -50 No default volume
2396 permErr -54 File is already open and cannot be opened using specified deny modes
2397 afpAccessDenied -5000 User does not have the correct access to the file
2398 afpDenyConflict -5006 Requested access permission not possible
2402 See also: FSpOpenAware, HOpenRFAware, FSpOpenRFAware
2405 /*****************************************************************************/
2407 pascal OSErr
FSpOpenAware(const FSSpec
*spec
,
2410 /* ¦ Open the data fork of a file using deny mode permissions.
2411 The FSpOpenAware function opens the data fork of a file using deny mode
2412 permissions instead the normal File Manager permissions. If OpenDeny
2413 is not available, then FSpOpenAware translates the deny modes to the
2414 closest File Manager permissions and tries to open the file with
2415 OpenDF first, and then Open if OpenDF isn't available. By using
2416 FSpOpenAware with deny mode permissions, a program can be "AppleShare
2417 aware" and fall back on the standard File Manager open calls
2420 spec input: An FSSpec record specifying the file.
2421 denyModes input: The deny modes access under which to open the file.
2422 refNum output: The file reference number of the opened file.
2426 nsvErr -35 No such volume
2427 tmfoErr -42 Too many files open
2428 fnfErr -43 File not found
2429 wPrErr -44 Volume locked by hardware
2430 fLckdErr -45 File is locked
2431 vLckdErr -46 Volume is locked or read-only
2432 opWrErr -49 File already open for writing
2433 paramErr -50 No default volume
2434 permErr -54 File is already open and cannot be opened using specified deny modes
2435 afpAccessDenied -5000 User does not have the correct access to the file
2436 afpDenyConflict -5006 Requested access permission not possible
2440 See also: HOpenAware, HOpenRFAware, FSpOpenRFAware
2443 /*****************************************************************************/
2445 pascal OSErr
HOpenRFAware(short vRefNum
,
2447 ConstStr255Param fileName
,
2450 /* ¦ Open the resource fork of a file using deny mode permissions.
2451 The HOpenRFAware function opens the resource fork of a file using deny
2452 mode permissions instead the normal File Manager permissions. If
2453 OpenRFDeny is not available, then HOpenRFAware translates the deny
2454 modes to the closest File Manager permissions and tries to open the
2455 file with OpenRF. By using HOpenRFAware with deny mode permissions,
2456 a program can be "AppleShare aware" and fall back on the standard
2457 File Manager open calls automatically.
2459 vRefNum input: Volume specification.
2460 dirID input: Directory ID.
2461 fileName input: The name of the file.
2462 denyModes input: The deny modes access under which to open the file.
2463 refNum output: The file reference number of the opened file.
2467 nsvErr -35 No such volume
2468 tmfoErr -42 Too many files open
2469 fnfErr -43 File not found
2470 wPrErr -44 Volume locked by hardware
2471 fLckdErr -45 File is locked
2472 vLckdErr -46 Volume is locked or read-only
2473 opWrErr -49 File already open for writing
2474 paramErr -50 No default volume
2475 permErr -54 File is already open and cannot be opened using specified deny modes
2476 afpAccessDenied -5000 User does not have the correct access to the file
2477 afpDenyConflict -5006 Requested access permission not possible
2481 See also: HOpenAware, FSpOpenAware, FSpOpenRFAware
2484 /*****************************************************************************/
2486 pascal OSErr
FSpOpenRFAware(const FSSpec
*spec
,
2489 /* ¦ Open the resource fork of a file using deny mode permissions.
2490 The FSpOpenRFAware function opens the resource fork of a file using deny
2491 mode permissions instead the normal File Manager permissions. If
2492 OpenRFDeny is not available, then FSpOpenRFAware translates the deny
2493 modes to the closest File Manager permissions and tries to open the
2494 file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
2495 a program can be "AppleShare aware" and fall back on the standard
2496 File Manager open calls automatically.
2498 spec input: An FSSpec record specifying the file.
2499 denyModes input: The deny modes access under which to open the file.
2500 refNum output: The file reference number of the opened file.
2504 nsvErr -35 No such volume
2505 tmfoErr -42 Too many files open
2506 fnfErr -43 File not found
2507 wPrErr -44 Volume locked by hardware
2508 fLckdErr -45 File is locked
2509 vLckdErr -46 Volume is locked or read-only
2510 opWrErr -49 File already open for writing
2511 paramErr -50 No default volume
2512 permErr -54 File is already open and cannot be opened using specified deny modes
2513 afpAccessDenied -5000 User does not have the correct access to the file
2514 afpDenyConflict -5006 Requested access permission not possible
2518 See also: HOpenAware, FSpOpenAware, HOpenRFAware
2521 /*****************************************************************************/
2523 pascal OSErr
FSReadNoCache(short refNum
,
2526 /* ¦ Read any number of bytes from an open file requesting no caching.
2527 The FSReadNoCache function reads any number of bytes from an open file
2528 while asking the file system to bypass its cache mechanism.
2530 refNum input: The file reference number of an open file.
2531 count input: The number of bytes to read.
2532 output: The number of bytes actually read.
2533 buffPtr input: A pointer to the data buffer into which the bytes are
2538 readErr Ð19 Driver does not respond to read requests
2539 badUnitErr Ð21 Driver reference number does not
2541 unitEmptyErr Ð22 Driver reference number specifies a
2542 nil handle in unit table
2543 abortErr Ð27 Request aborted by KillIO
2544 notOpenErr Ð28 Driver not open
2545 ioErr Ð36 Data does not match in read-verify mode
2546 fnOpnErr -38 File not open
2547 rfNumErr -51 Bad reference number
2548 afpAccessDenied -5000 User does not have the correct access to
2553 See also: FSWriteNoCache
2556 /*****************************************************************************/
2558 pascal OSErr
FSWriteNoCache(short refNum
,
2560 const void *buffPtr
);
2561 /* ¦ Write any number of bytes to an open file requesting no caching.
2562 The FSReadNoCache function writes any number of bytes to an open file
2563 while asking the file system to bypass its cache mechanism.
2565 refNum input: The file reference number of an open file.
2566 count input: The number of bytes to write to the file.
2567 output: The number of bytes actually written.
2568 buffPtr input: A pointer to the data buffer from which the bytes are
2573 writErr Ð20 Driver does not respond to write requests
2574 badUnitErr Ð21 Driver reference number does not
2576 unitEmptyErr Ð22 Driver reference number specifies a
2577 nil handle in unit table
2578 abortErr Ð27 Request aborted by KillIO
2579 notOpenErr Ð28 Driver not open
2580 dskFulErr -34 Disk full
2581 ioErr Ð36 Data does not match in read-verify mode
2582 fnOpnErr -38 File not open
2583 wPrErr -44 Hardware volume lock
2584 fLckdErr -45 File is locked
2585 vLckdErr -46 Software volume lock
2586 rfNumErr -51 Bad reference number
2587 wrPermErr -61 Read/write permission doesnÕt
2589 afpAccessDenied -5000 User does not have the correct access to
2594 See also: FSReadNoCache
2597 /*****************************************************************************/
2599 pascal OSErr
FSWriteVerify(short refNum
,
2601 const void *buffPtr
);
2602 /* ¦ Write any number of bytes to an open file and then verify the data was written.
2603 The FSWriteVerify function writes any number of bytes to an open file
2604 and then verifies that the data was actually written to the device.
2606 refNum input: The file reference number of an open file.
2607 count input: The number of bytes to write to the file.
2608 output: The number of bytes actually written and verified.
2609 buffPtr input: A pointer to the data buffer from which the bytes are
2614 readErr Ð19 Driver does not respond to read requests
2615 writErr Ð20 Driver does not respond to write requests
2616 badUnitErr Ð21 Driver reference number does not
2618 unitEmptyErr Ð22 Driver reference number specifies a
2619 nil handle in unit table
2620 abortErr Ð27 Request aborted by KillIO
2621 notOpenErr Ð28 Driver not open
2622 dskFulErr -34 Disk full
2623 ioErr Ð36 Data does not match in read-verify mode
2624 fnOpnErr -38 File not open
2625 eofErr -39 Logical end-of-file reached
2626 posErr -40 Attempt to position mark before start
2628 wPrErr -44 Hardware volume lock
2629 fLckdErr -45 File is locked
2630 vLckdErr -46 Software volume lock
2631 rfNumErr -51 Bad reference number
2632 gfpErr -52 Error during GetFPos
2633 wrPermErr -61 Read/write permission doesnÕt
2635 memFullErr -108 Not enough room in heap zone to allocate
2637 afpAccessDenied -5000 User does not have the correct access to
2641 /*****************************************************************************/
2643 pascal OSErr
CopyFork(short srcRefNum
,
2645 void *copyBufferPtr
,
2646 long copyBufferSize
);
2647 /* ¦ Copy all data from the source fork to the destination fork of open file forks.
2648 The CopyFork function copies all data from the source fork to the
2649 destination fork of open file forks and makes sure the destination EOF
2650 is equal to the source EOF.
2652 srcRefNum input: The source file reference number.
2653 dstRefNum input: The destination file reference number.
2654 copyBufferPtr input: Pointer to buffer to use during copy. The
2655 buffer should be at least 512-bytes minimum.
2656 The larger the buffer, the faster the copy.
2657 copyBufferSize input: The size of the copy buffer.
2661 readErr Ð19 Driver does not respond to read requests
2662 writErr Ð20 Driver does not respond to write requests
2663 badUnitErr Ð21 Driver reference number does not
2665 unitEmptyErr Ð22 Driver reference number specifies a
2666 nil handle in unit table
2667 abortErr Ð27 Request aborted by KillIO
2668 notOpenErr Ð28 Driver not open
2669 dskFulErr -34 Disk full
2670 ioErr Ð36 Data does not match in read-verify mode
2671 fnOpnErr -38 File not open
2672 wPrErr -44 Hardware volume lock
2673 fLckdErr -45 File is locked
2674 vLckdErr -46 Software volume lock
2675 rfNumErr -51 Bad reference number
2676 wrPermErr -61 Read/write permission doesnÕt
2678 afpAccessDenied -5000 User does not have the correct access to
2682 /*****************************************************************************/
2684 pascal OSErr
GetFileLocation(short refNum
,
2687 StringPtr fileName
);
2688 /* ¦ Get the location of an open file.
2689 The GetFileLocation function gets the location (volume reference number,
2690 directory ID, and fileName) of an open file.
2692 refNum input: The file reference number of an open file.
2693 vRefNum output: The volume reference number.
2694 dirID output: The parent directory ID.
2695 fileName input: Points to a buffer (minimum Str63) where the
2696 filename is to be returned or must be nil.
2697 output: The filename.
2701 nsvErr -35 Specified volume doesnÕt exist
2702 fnOpnErr -38 File not open
2703 rfNumErr -51 Reference number specifies nonexistent
2708 See also: FSpGetFileLocation
2711 /*****************************************************************************/
2713 pascal OSErr
FSpGetFileLocation(short refNum
,
2715 /* ¦ Get the location of an open file in an FSSpec record.
2716 The FSpGetFileLocation function gets the location of an open file in
2719 refNum input: The file reference number of an open file.
2720 spec output: FSSpec record containing the file name and location.
2724 nsvErr -35 Specified volume doesnÕt exist
2725 fnOpnErr -38 File not open
2726 rfNumErr -51 Reference number specifies nonexistent
2731 See also: GetFileLocation
2734 /*****************************************************************************/
2736 pascal OSErr
CopyDirectoryAccess(short srcVRefNum
,
2738 ConstStr255Param srcName
,
2741 ConstStr255Param dstName
);
2742 /* ¦ Copy the AFP directory access privileges.
2743 The CopyDirectoryAccess function copies the AFP directory access
2744 privileges from one directory to another. Both directories must be on
2745 the same file server, but not necessarily on the same server volume.
2747 srcVRefNum input: Source volume specification.
2748 srcDirID input: Source directory ID.
2749 srcName input: Pointer to source directory name, or nil when
2750 srcDirID specifies the directory.
2751 dstVRefNum input: Destination volume specification.
2752 dstDirID input: Destination directory ID.
2753 dstName input: Pointer to destination directory name, or nil when
2754 dstDirID specifies the directory.
2758 nsvErr -35 Volume not found
2759 fnfErr -43 Directory not found
2760 vLckdErr -46 Volume is locked or read-only
2761 paramErr -50 Volume doesn't support this function
2762 afpAccessDenied -5000 User does not have the correct access
2764 afpObjectTypeErr -5025 Object is a file, not a directory
2768 See also: FSpCopyDirectoryAccess
2771 /*****************************************************************************/
2773 pascal OSErr
FSpCopyDirectoryAccess(const FSSpec
*srcSpec
,
2774 const FSSpec
*dstSpec
);
2775 /* ¦ Copy the AFP directory access privileges.
2776 The FSpCopyDirectoryAccess function copies the AFP directory access
2777 privileges from one directory to another. Both directories must be on
2778 the same file server, but not necessarily on the same server volume.
2780 srcSpec input: An FSSpec record specifying the source directory.
2781 dstSpec input: An FSSpec record specifying the destination directory.
2785 nsvErr -35 Volume not found
2786 fnfErr -43 Directory not found
2787 vLckdErr -46 Volume is locked or read-only
2788 paramErr -50 Volume doesn't support this function
2789 afpAccessDenied -5000 User does not have the correct access
2791 afpObjectTypeErr -5025 Object is a file, not a directory
2795 See also: CopyDirectoryAccess
2798 /*****************************************************************************/
2800 pascal OSErr
HMoveRenameCompat(short vRefNum
,
2802 ConstStr255Param srcName
,
2804 ConstStr255Param dstpathName
,
2805 ConstStr255Param copyName
);
2806 /* ¦ Move a file or directory and optionally rename it.
2807 The HMoveRenameCompat function moves a file or directory and optionally
2808 renames it. The source and destination locations must be on the same
2809 volume. This routine works even if the volume doesn't support MoveRename.
2811 vRefNum input: Volume specification.
2812 srcDirID input: Source directory ID.
2813 srcName input: The source object name.
2814 dstDirID input: Destination directory ID.
2815 dstName input: Pointer to destination directory name, or
2816 nil when dstDirID specifies a directory.
2817 copyName input: Points to the new name if the object is to be
2818 renamed or nil if the object isn't to be renamed.
2822 dirFulErr -33 File directory full
2823 dskFulErr -34 Disk is full
2824 nsvErr -35 Volume not found
2826 bdNamErr -37 Bad filename or attempt to move into
2828 fnfErr -43 Source file or directory not found
2829 wPrErr -44 Hardware volume lock
2830 fLckdErr -45 File is locked
2831 vLckdErr -46 Destination volume is read-only
2832 fBsyErr -47 File busy, directory not empty, or
2833 working directory control block open
2834 dupFNErr -48 Destination already exists
2835 paramErr -50 Volume doesn't support this function,
2836 no default volume, or source and
2837 volOfflinErr -53 Volume is offline
2838 fsRnErr -59 Problem during rename
2839 dirNFErr -120 Directory not found or incomplete pathname
2840 badMovErr -122 Attempted to move directory into
2842 wrgVolTypErr -123 Not an HFS volume (it's a MFS volume)
2843 notAFileErr -1302 The pathname is nil, the pathname
2844 is empty, or the pathname cannot refer
2846 diffVolErr -1303 Files on different volumes
2847 afpAccessDenied -5000 The user does not have the right to
2848 move the file or directory
2849 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2850 afpSameObjectErr -5038 Source and destination files are the same
2854 See also: FSpMoveRenameCompat
2857 /*****************************************************************************/
2859 pascal OSErr
FSpMoveRenameCompat(const FSSpec
*srcSpec
,
2860 const FSSpec
*dstSpec
,
2861 ConstStr255Param copyName
);
2862 /* ¦ Move a file or directory and optionally rename it.
2863 The FSpMoveRenameCompat function moves a file or directory and optionally
2864 renames it. The source and destination locations must be on the same
2865 volume. This routine works even if the volume doesn't support MoveRename.
2867 srcSpec input: An FSSpec record specifying the source object.
2868 dstSpec input: An FSSpec record specifying the destination
2870 copyName input: Points to the new name if the object is to be
2871 renamed or nil if the object isn't to be renamed.
2875 dirFulErr -33 File directory full
2876 dskFulErr -34 Disk is full
2877 nsvErr -35 Volume not found
2879 bdNamErr -37 Bad filename or attempt to move into
2881 fnfErr -43 Source file or directory not found
2882 wPrErr -44 Hardware volume lock
2883 fLckdErr -45 File is locked
2884 vLckdErr -46 Destination volume is read-only
2885 fBsyErr -47 File busy, directory not empty, or
2886 working directory control block open
2887 dupFNErr -48 Destination already exists
2888 paramErr -50 Volume doesn't support this function,
2889 no default volume, or source and
2890 volOfflinErr -53 Volume is offline
2891 fsRnErr -59 Problem during rename
2892 dirNFErr -120 Directory not found or incomplete pathname
2893 badMovErr -122 Attempted to move directory into
2895 wrgVolTypErr -123 Not an HFS volume (it's a MFS volume)
2896 notAFileErr -1302 The pathname is nil, the pathname
2897 is empty, or the pathname cannot refer
2899 diffVolErr -1303 Files on different volumes
2900 afpAccessDenied -5000 The user does not have the right to
2901 move the file or directory
2902 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2903 afpSameObjectErr -5038 Source and destination files are the same
2907 See also: HMoveRenameCompat
2910 /*****************************************************************************/
2912 pascal OSErr
BuildAFPVolMountInfo(short flags
,
2922 AFPVolMountInfoPtr
*afpInfoPtr
);
2923 /* ¦ Allocate and initializes the fields of an AFPVolMountInfo record.
2924 The BuildAFPVolMountInfo function allocates and initializes the fields
2925 of an AFPVolMountInfo record before using that record to call
2926 the VolumeMount function.
2928 flags input: The AFP mounting flags. 0 = normal mount;
2929 set bit 0 to inhibit greeting messages.
2930 nbpInterval input: The interval used for VolumeMount's
2931 NBP Lookup call. 7 is a good choice.
2932 nbpCount input: The retry count used for VolumeMount's
2933 NBP Lookup call. 5 is a good choice.
2934 uamType input: The user authentication method to use.
2935 zoneName input: The AppleTalk zone name of the server.
2936 serverName input: The AFP server name.
2937 volName input: The AFP volume name.
2938 userName input: The user name (zero length Pascal string for
2940 userPassWord input: The user password (zero length Pascal string
2941 if no user password)
2942 volPassWord input: The volume password (zero length Pascal string
2943 if no volume password)
2944 afpInfoPtr output: A pointer to the newly created and initialized
2945 AFPVolMountInfo record. If the function fails to
2946 create an AFPVolMountInfo record, it sets
2947 afpInfoPtr to NULL and the function result is
2948 memFullErr. Your program is responsible
2949 for disposing of this pointer when it is finished
2954 memFullErr -108 memory full error
2958 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
2959 RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo,
2960 RetrieveAFPXVolMountInfo
2963 /*****************************************************************************/
2965 pascal OSErr
RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr
,
2969 StringPtr serverName
,
2971 StringPtr userName
);
2972 /* ¦ Retrieve the AFP mounting information from an AFPVolMountInfo record.
2973 The RetrieveAFPVolMountInfo function retrieves the AFP mounting
2974 information returned in an AFPVolMountInfo record by the
2975 GetVolMountInfo function.
2977 afpInfoPtr input: Pointer to AFPVolMountInfo record that contains
2978 the AFP mounting information.
2979 flags output: The AFP mounting flags.
2980 uamType output: The user authentication method used.
2981 zoneName output: The AppleTalk zone name of the server.
2982 serverName output: The AFP server name.
2983 volName output: The AFP volume name.
2984 userName output: The user name (zero length Pascal string for
2989 paramErr -50 media field in AFP mounting information
2990 was not AppleShareMediaType
2994 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
2995 BuildAFPVolMountInfo, BuildAFPXVolMountInfo,
2996 RetrieveAFPXVolMountInfo
2999 /*****************************************************************************/
3001 pascal OSErr
BuildAFPXVolMountInfo(short flags
,
3012 unsigned long alternateAddressLength
,
3013 void *alternateAddress
,
3014 AFPXVolMountInfoPtr
*afpXInfoPtr
);
3015 /* ¦ Allocate and initializes the fields of an AFPXVolMountInfo record.
3016 The BuildAFPXVolMountInfo function allocates and initializes the fields
3017 of an AFPXVolMountInfo record before using that record to call
3018 the VolumeMount function.
3020 flags input: The AFP mounting flags.
3021 nbpInterval input: The interval used for VolumeMount's
3022 NBP Lookup call. 7 is a good choice.
3023 nbpCount input: The retry count used for VolumeMount's
3024 NBP Lookup call. 5 is a good choice.
3025 uamType input: The user authentication method to use.
3026 zoneName input: The AppleTalk zone name of the server.
3027 serverName input: The AFP server name.
3028 volName input: The AFP volume name.
3029 userName input: The user name (zero length Pascal string
3031 userPassWord input: The user password (zero length Pascal
3032 string if no user password)
3033 volPassWord input: The volume password (zero length Pascal
3034 string if no volume password)
3035 uamName input: The User Authentication Method name.
3036 alternateAddressLength input: Length of alternateAddress data.
3037 alternateAddress input The AFPAlternateAddress (variable length)
3038 afpXInfoPtr output: A pointer to the newly created and
3039 initialized AFPVolMountInfo record.
3040 If the function fails to create an
3041 AFPVolMountInfo record, it sets
3042 afpInfoPtr to NULL and the function
3043 result is memFullErr. Your program is
3044 responsible for disposing of this pointer
3045 when it is finished with it.
3049 memFullErr -108 memory full error
3053 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
3054 BuildAFPVolMountInfo, RetrieveAFPVolMountInfo,
3055 RetrieveAFPXVolMountInfo
3058 /*****************************************************************************/
3060 pascal OSErr
RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr
,
3064 StringPtr serverName
,
3068 unsigned long *alternateAddressLength
,
3069 AFPAlternateAddress
**alternateAddress
);
3070 /* ¦ Retrieve the AFP mounting information from an AFPXVolMountInfo record.
3071 The RetrieveAFPXVolMountInfo function retrieves the AFP mounting
3072 information returned in an AFPXVolMountInfo record by the
3073 GetVolMountInfo function.
3075 afpXInfoPtr input: Pointer to AFPXVolMountInfo record that
3076 contains the AFP mounting information.
3077 flags output: The AFP mounting flags.
3078 uamType output: The user authentication method used.
3079 zoneName output: The AppleTalk zone name of the server.
3080 serverName output: The AFP server name.
3081 volName output: The AFP volume name.
3082 userName output: The user name (zero length Pascal
3084 uamName output: The User Authentication Method name.
3085 alternateAddressLength output: Length of alternateAddress data returned.
3086 alternateAddress: output: A pointer to the newly created and
3087 AFPAlternateAddress record (a variable
3088 length record). If the function fails to
3089 create an AFPAlternateAddress record,
3090 it sets alternateAddress to NULL and the
3091 function result is memFullErr. Your
3092 program is responsible for disposing of
3093 this pointer when it is finished with it.
3097 paramErr -50 media field in AFP mounting information
3098 was not AppleShareMediaType
3099 memFullErr -108 memory full error
3103 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
3104 BuildAFPVolMountInfo, RetrieveAFXVolMountInfo,
3105 BuildAFPXVolMountInfo
3108 /*****************************************************************************/
3110 pascal OSErr
GetUGEntries(short objType
,
3113 long *actEntryCount
,
3115 /* ¦ Retrieve a list of user or group entries from the local file server.
3116 The GetUGEntries functions retrieves a list of user or group entries
3117 from the local file server.
3119 objType input: The object type: -1 = group; 0 = user
3120 UGEntries input: Pointer to array of UGEntry records where the list
3122 reqEntryCount input: The number of elements in the UGEntries array.
3123 actEntryCount output: The number of entries returned.
3124 objID input: The current index position. Set to 0 to start with
3126 output: The index position to get the next entry. Pass this
3127 value the next time you call GetUGEntries to start
3132 fnfErr -43 No more users or groups
3133 paramErr -50 Function not supported; or, ioObjID is
3138 Also see: GetUGEntry
3141 /*****************************************************************************/
3147 #include "optimend.h"
3149 #endif /* __MOREFILESEXTRAS__ */