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_ALIGN_SUPPORTED
219 #pragma options align=mac68k
223 ** For those times where you need to use more than one kind of File Manager parameter
224 ** block but don't feel like wasting stack space, here's a parameter block you can reuse.
238 typedef union UniversalFMPB UniversalFMPB
;
239 typedef UniversalFMPB
*UniversalFMPBPtr
, **UniversalFMPBHandle
;
243 ** Used by GetUGEntries to return user or group lists
248 short objType
; /* object type: -1 = group; 0 = user */
249 long objID
; /* the user or group ID */
250 Str31 name
; /* the user or group name */
252 typedef struct UGEntry UGEntry
;
253 typedef UGEntry
*UGEntryPtr
, **UGEntryHandle
;
256 typedef unsigned char Str8
[9];
260 ** I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h
263 struct MyAFPVolMountInfo
265 short length
; /* length of this record */
266 VolumeType media
; /* type of media, always AppleShareMediaType */
267 short flags
; /* 0 = normal mount; set bit 0 to inhibit greeting messages */
268 char nbpInterval
; /* NBP interval parameter; 7 is a good choice */
269 char nbpCount
; /* NBP count parameter; 5 is a good choice */
270 short uamType
; /* User Authentication Method */
271 short zoneNameOffset
; /* offset from start of record to zoneName */
272 short serverNameOffset
; /* offset from start of record to serverName */
273 short volNameOffset
; /* offset from start of record to volName */
274 short userNameOffset
; /* offset from start of record to userName */
275 short userPasswordOffset
; /* offset from start of record to userPassword */
276 short volPasswordOffset
; /* offset from start of record to volPassword */
277 Str32 zoneName
; /* server's AppleTalk zone name */
278 char filler1
; /* to word align volPassword */
279 Str32 serverName
; /* server name */
280 char filler2
; /* to word align volPassword */
281 Str27 volName
; /* volume name */
282 Str31 userName
; /* user name (zero length Pascal string for guest) */
283 Str8 userPassword
; /* user password (zero length Pascal string if no user password) */
284 char filler3
; /* to word align volPassword */
285 Str8 volPassword
; /* volume password (zero length Pascal string if no volume password) */
286 char filler4
; /* to end record on word boundry */
288 typedef struct MyAFPVolMountInfo MyAFPVolMountInfo
;
289 typedef MyAFPVolMountInfo
*MyAFPVolMountInfoPtr
, **MyAFPVolMountInfoHandle
;
291 struct MyAFPXVolMountInfo
293 short length
; /* length of this record */
294 VolumeType media
; /* type of media, always AppleShareMediaType */
295 short flags
; /* bits for no messages, no reconnect, etc */
296 char nbpInterval
; /* NBP interval parameter; 7 is a good choice */
297 char nbpCount
; /* NBP count parameter; 5 is a good choice */
298 short uamType
; /* User Authentication Method */
299 short zoneNameOffset
; /* offset from start of record to zoneName */
300 short serverNameOffset
; /* offset from start of record to serverName */
301 short volNameOffset
; /* offset from start of record to volName */
302 short userNameOffset
; /* offset from start of record to userName */
303 short userPasswordOffset
; /* offset from start of record to userPassword */
304 short volPasswordOffset
; /* offset from start of record to volPassword */
305 short extendedFlags
; /* extended flags word */
306 short uamNameOffset
; /* offset to a pascal UAM name string */
307 short alternateAddressOffset
; /* offset to Alternate Addresses in tagged format */
308 Str32 zoneName
; /* server's AppleTalk zone name */
309 char filler1
; /* to word align volPassword */
310 Str32 serverName
; /* server name */
311 char filler2
; /* to word align volPassword */
312 Str27 volName
; /* volume name */
313 Str31 userName
; /* user name (zero length Pascal string for guest) */
314 Str8 userPassword
; /* user password (zero length Pascal string if no user password) */
315 char filler3
; /* to word align volPassword */
316 Str8 volPassword
; /* volume password (zero length Pascal string if no volume password) */
317 char filler4
; /* to word align uamNameOffset */
318 Str32 uamName
; /* UAM name */
319 char filler5
; /* to word align alternateAddress */
320 char alternateAddress
[kVariableLengthArray
]; /* AFPAlternateAddress */
322 typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo
;
323 typedef MyAFPXVolMountInfo
*MyAFPXVolMountInfoPtr
, **MyAFPXVolMountInfoHandle
;
325 #if PRAGMA_ALIGN_SUPPORTED
326 #pragma options align=reset
329 /*****************************************************************************/
331 pascal void TruncPString(StringPtr destination
,
332 ConstStr255Param source
,
334 /* ¦ International friendly string truncate routine.
335 The TruncPString function copies up to maxLength characters from
336 the source Pascal string to the destination Pascal string. TruncPString
337 ensures that the truncated string ends on a single-byte character, or on
338 the last byte of a multi-byte character.
340 destination output: destination Pascal string.
341 source input: source Pascal string.
342 maxLength output: The maximum allowable length of the destination
346 /*****************************************************************************/
348 pascal Ptr
GetTempBuffer(long buffReqSize
,
350 /* ¦ Allocate a temporary copy or search buffer.
351 The GetTempBuffer function allocates a temporary buffer for file system
352 operations which is at least 1024 bytes (1K) and a multiple of
355 buffReqSize input: Size you'd like the buffer to be.
356 buffActSize output: Size of buffer allocated.
357 function result output: Pointer to memory allocated or nil if no memory
358 was available. The caller is responsible for
359 disposing of this buffer with DisposePtr.
362 /*****************************************************************************/
364 pascal OSErr
GetVolumeInfoNoName(ConstStr255Param pathname
,
367 /* ¦ Call PBHGetVInfoSync ignoring returned name.
368 GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync
369 in cases where the returned volume name is not needed by the caller.
370 The pathname and vRefNum parameters are not touched, and the pb
371 parameter is initialized by PBHGetVInfoSync except that ioNamePtr in
372 the parameter block is always returned as NULL (since it might point
373 to GetVolumeInfoNoName's local variable tempPathname).
375 I noticed using this code in several places, so here it is once.
376 This reduces the code size of MoreFiles.
378 pathName input: Pointer to a full pathname or nil. If you pass in a
379 partial pathname, it is ignored. A full pathname to a
380 volume must end with a colon character (:).
381 vRefNum input: Volume specification (volume reference number, working
382 directory number, drive number, or 0).
383 pb input: A pointer to HParamBlockRec.
384 output: The parameter block as filled in by PBHGetVInfoSync
385 except that ioNamePtr will always be NULL.
389 nsvErr -35 No such volume
390 paramErr -50 No default volume, or pb was NULL
393 /*****************************************************************************/
395 pascal OSErr
XGetVolumeInfoNoName(ConstStr255Param pathname
,
398 /* ¦ Call PBXGetVolInfoSync ignoring returned name.
399 XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync
400 in cases where the returned volume name is not needed by the caller.
401 The pathname and vRefNum parameters are not touched, and the pb
402 parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in
403 the parameter block is always returned as NULL (since it might point
404 to XGetVolumeInfoNoName's local variable tempPathname).
406 pathName input: Pointer to a full pathname or nil. If you pass in a
407 partial pathname, it is ignored. A full pathname to a
408 volume must end with a colon character (:).
409 vRefNum input: Volume specification (volume reference number, working
410 directory number, drive number, or 0).
411 pb input: A pointer to HParamBlockRec.
412 output: The parameter block as filled in by PBXGetVolInfoSync
413 except that ioNamePtr will always be NULL.
417 nsvErr -35 No such volume
418 paramErr -50 No default volume, or pb was NULL
421 /*****************************************************************************/
423 pascal OSErr
GetCatInfoNoName(short vRefNum
,
425 ConstStr255Param name
,
427 /* ¦ Call PBGetCatInfoSync ignoring returned name.
428 GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync
429 in cases where the returned object is not needed by the caller.
430 The vRefNum, dirID and name parameters are not touched, and the pb
431 parameter is initialized by PBGetCatInfoSync except that ioNamePtr in
432 the parameter block is always returned as NULL (since it might point
433 to GetCatInfoNoName's local variable tempName).
435 I noticed using this code in several places, so here it is once.
436 This reduces the code size of MoreFiles.
438 vRefNum input: Volume specification.
439 dirID input: Directory ID.
440 name input: Pointer to object name, or nil when dirID
441 specifies a directory that's the object.
442 pb input: A pointer to CInfoPBRec.
443 output: The parameter block as filled in by
444 PBGetCatInfoSync except that ioNamePtr will
449 nsvErr -35 No such volume
451 bdNamErr -37 Bad filename
452 fnfErr -43 File not found
453 paramErr -50 No default volume
454 dirNFErr -120 Directory not found or incomplete pathname
455 afpAccessDenied -5000 User does not have the correct access
456 afpObjectTypeErr -5025 Directory not found or incomplete pathname
460 /*****************************************************************************/
462 pascal OSErr
DetermineVRefNum(ConstStr255Param pathname
,
465 /* ¦ Determine the real volume reference number.
466 The DetermineVRefNum function determines the volume reference number of
467 a volume from a pathname, a volume specification, or a combination
469 WARNING: Volume names on the Macintosh are *not* unique -- Multiple
470 mounted volumes can have the same name. For this reason, the use of a
471 volume name or full pathname to identify a specific volume may not
472 produce the results you expect. If more than one volume has the same
473 name and a volume name or full pathname is used, the File Manager
474 currently uses the first volume it finds with a matching name in the
477 pathName input: Pointer to a full pathname or nil. If you pass in a
478 partial pathname, it is ignored. A full pathname to a
479 volume must end with a colon character (:).
480 vRefNum input: Volume specification (volume reference number, working
481 directory number, drive number, or 0).
482 realVRefNum output: The real volume reference number.
486 nsvErr -35 No such volume
487 paramErr -50 No default volume
490 /*****************************************************************************/
492 pascal OSErr
HGetVInfo(short volReference
,
495 unsigned long *freeBytes
,
496 unsigned long *totalBytes
);
497 /* ¦ Get information about a mounted volume.
498 The HGetVInfo function returns the name, volume reference number,
499 available space (in bytes), and total space (in bytes) for the
500 specified volume. You can specify the volume by providing its drive
501 number, volume reference number, or 0 for the default volume.
502 This routine is compatible with volumes up to 4 gigabytes.
504 volReference input: The drive number, volume reference number,
505 or 0 for the default volume.
506 volName input: A pointer to a buffer (minimum Str27) where
507 the volume name is to be returned or must
509 output: The volume name.
510 vRefNum output: The volume reference number.
511 freeBytes output: The number of free bytes on the volume.
512 freeBytes is an unsigned long value.
513 totalBytes output: The total number of bytes on the volume.
514 totalBytes is an unsigned long value.
518 nsvErr -35 No such volume
519 paramErr -50 No default volume
526 /*****************************************************************************/
528 pascal OSErr
XGetVInfo(short volReference
,
531 UnsignedWide
*freeBytes
,
532 UnsignedWide
*totalBytes
);
533 /* ¦ Get extended information about a mounted volume.
534 The XGetVInfo function returns the name, volume reference number,
535 available space (in bytes), and total space (in bytes) for the
536 specified volume. You can specify the volume by providing its drive
537 number, volume reference number, or 0 for the default volume.
538 This routine is compatible with volumes up to 2 terabytes.
540 volReference input: The drive number, volume reference number,
541 or 0 for the default volume.
542 volName input: A pointer to a buffer (minimum Str27) where
543 the volume name is to be returned or must
545 output: The volume name.
546 vRefNum output: The volume reference number.
547 freeBytes output: The number of free bytes on the volume.
548 freeBytes is an UnsignedWide value.
549 totalBytes output: The total number of bytes on the volume.
550 totalBytes is an UnsignedWide value.
554 nsvErr -35 No such volume
555 paramErr -50 No default volume
562 /*****************************************************************************/
564 pascal OSErr
CheckVolLock(ConstStr255Param pathname
,
566 /* ¦ Determine if a volume is locked.
567 The CheckVolLock function determines if a volume is locked - either by
568 hardware or by software. If CheckVolLock returns noErr, then the volume
571 pathName input: Pointer to a full pathname or nil. If you pass in a
572 partial pathname, it is ignored. A full pathname to a
573 volume must end with a colon character (:).
574 vRefNum input: Volume specification (volume reference number, working
575 directory number, drive number, or 0).
578 noErr 0 No error - volume not locked
579 nsvErr -35 No such volume
580 wPrErr -44 Volume locked by hardware
581 vLckdErr -46 Volume locked by software
582 paramErr -50 No default volume
585 /*****************************************************************************/
587 pascal OSErr
GetDriverName(short driverRefNum
,
589 /* ¦ Get a device driver's name.
590 The GetDriverName function returns a device driver's name.
592 driverRefNum input: The driver reference number.
593 driverName output: The driver's name.
597 badUnitErr -21 Bad driver reference number
600 /*****************************************************************************/
602 pascal OSErr
FindDrive(ConstStr255Param pathname
,
604 DrvQElPtr
*driveQElementPtr
);
605 /* ¦ Find a volume's drive queue element in the drive queue.
606 The FindDrive function returns a pointer to a mounted volume's
609 pathName input: Pointer to a full pathname or nil. If you
610 pass in a partial pathname, it is ignored.
611 A full pathname to a volume must end with
612 a colon character (:).
613 vRefNum input: Volume specification (volume reference
614 number, working directory number, drive
616 driveQElementPtr output: Pointer to a volume's drive queue element
617 in the drive queue. DO NOT change the
622 nsvErr -35 No such volume
623 paramErr -50 No default volume
624 nsDrvErr -56 No such drive
627 /*****************************************************************************/
629 pascal OSErr
GetDiskBlocks(ConstStr255Param pathname
,
631 unsigned long *numBlocks
);
632 /* ¦ Return the number of physical disk blocks on a disk drive.
633 The GetDiskBlocks function returns the number of physical disk
634 blocks on a disk drive. NOTE: This is not the same as volume
637 pathName input: Pointer to a full pathname or nil. If you
638 pass in a partial pathname, it is ignored.
639 A full pathname to a volume must end with
640 a colon character (:).
641 vRefNum input: Volume specification (volume reference
642 number, working directory number, drive
644 numBlocks output: The number of physical disk blocks on the disk drive.
648 nsvErr -35 No such volume
649 paramErr -50 No default volume, driver reference
650 number is zero, ReturnFormatList
651 returned zero blocks, DriveStatus
652 returned an unknown value, or
653 driveQElementPtr->qType is unknown
654 nsDrvErr -56 No such drive
655 statusErr Ð18 Driver does not respond to this
657 badUnitErr Ð21 Driver reference number does not
659 unitEmptyErr Ð22 Driver reference number specifies
660 a nil handle in unit table
661 abortErr Ð27 Request aborted by KillIO
662 notOpenErr Ð28 Driver not open
665 /*****************************************************************************/
667 pascal OSErr
GetVolFileSystemID(ConstStr255Param pathname
,
669 short *fileSystemID
);
670 /* ¦ Get a volume's file system ID.
671 The GetVolFileSystemID function returned the file system ID of
672 a mounted volume. The file system ID identifies the file system
673 that handles requests to a particular volume. Here's a partial list
674 of file system ID numbers (only Apple's file systems are listed):
676 ----- -----------------------------------------------------
677 $0000 Macintosh HFS or MFS
678 $0100 ProDOS File System
679 $0101 PowerTalk Mail Enclosures
680 $4147 ISO 9660 File Access (through Foreign File Access)
681 $4242 High Sierra File Access (through Foreign File Access)
682 $464D QuickTake File System (through Foreign File Access)
683 $4953 Macintosh PC Exchange (MS-DOS)
684 $4A48 Audio CD Access (through Foreign File Access)
685 $4D4B Apple Photo Access (through Foreign File Access)
687 See the Technical Note "FL 35 - Determining Which File System
688 Is Active" and the "Guide to the File System Manager" for more
691 pathName input: Pointer to a full pathname or nil. If you pass
692 in a partial pathname, it is ignored. A full
693 pathname to a volume must contain at least
694 one colon character (:) and must not start with
696 vRefNum input: Volume specification (volume reference number,
697 working directory number, drive number, or 0).
698 fileSystemID output: The volume's file system ID.
702 nsvErr -35 No such volume
703 paramErr -50 No default volume, or pb was NULL
706 /*****************************************************************************/
708 pascal OSErr
GetVolState(ConstStr255Param pathname
,
710 Boolean
*volumeOnline
,
711 Boolean
*volumeEjected
,
712 Boolean
*driveEjectable
,
713 Boolean
*driverWantsEject
);
714 /* ¦ Returns a volume's online and eject information.
715 The GetVolState function determines if a volume is online or offline,
716 if an offline volume is ejected, and if the volume's driver is
717 ejectable or wants eject calls.
719 pathName input: Pointer to a full pathname or nil.
720 vRefNum input: Volume specification (volume reference number,
721 working directory number, drive number, or 0).
722 volumeOnline output: True if the volume is online;
723 False if the volume is offline.
724 volumeEjected output: True if the volume is ejected (ejected
725 volumes are always offline); False if the
726 volume is not ejected.
727 driveEjectable output: True if the volume's drive is ejectable;
728 False if the volume's drive is not ejectable.
729 driverWantsEject output: True if the volume's driver wants an Eject
730 request after unmount (even if the drive
731 is not ejectable); False if the volume's
732 driver does not need an eject request.
736 nsvErr -35 No such volume
737 paramErr -50 No default volume, or pb was NULL
740 /*****************************************************************************/
742 pascal OSErr
UnmountAndEject(ConstStr255Param pathname
,
744 /* ¦ Unmount and eject a volume.
745 The UnmountAndEject function unmounts and ejects a volume. The volume
746 is ejected only if it is ejectable and not already ejected.
748 pathName input: Pointer to a full pathname or nil. If you pass in a
749 partial pathname, it is ignored. A full pathname to a
750 volume must end with a colon character (:).
751 vRefNum input: Volume specification (volume reference number, working
752 directory number, drive number, or 0).
756 nsvErr -35 No such volume
758 bdNamErr -37 Bad volume name
759 fBsyErr -47 One or more files are open
760 paramErr -50 No default volume
761 nsDrvErr -56 No such drive
762 extFSErr -58 External file system error - no file
763 system claimed this call.
766 /*****************************************************************************/
768 pascal OSErr
OnLine(FSSpecPtr volumes
,
772 /* ¦ Return the list of volumes currently mounted.
773 The OnLine function returns the list of volumes currently mounted in
774 an array of FSSpec records.
776 A noErr result indicates that the volumes array was filled
777 (actVolCount == reqVolCount) and there may be additional volumes
778 mounted. A nsvErr result indicates that the end of the volume list
779 was found and actVolCount volumes were actually found this time.
781 volumes input: Pointer to array of FSSpec where the volume list
783 reqVolCount input: Maximum number of volumes to return (the number of
784 elements in the volumes array).
785 actVolCount output: The number of volumes actually returned.
786 volIndex input: The current volume index position. Set to 1 to
787 start with the first volume.
788 output: The volume index position to get the next volume.
789 Pass this value the next time you call OnLine to
790 start where you left off.
793 noErr 0 No error, but there are more volumes
795 nsvErr -35 No more volumes to be listed
796 paramErr -50 volIndex was <= 0
799 /*****************************************************************************/
801 pascal OSErr
SetDefault(short newVRefNum
,
805 /* ¦ Set the default volume before making Standard I/O requests.
806 The SetDefault function sets the default volume and directory to the
807 volume specified by newVRefNum and the directory specified by newDirID.
808 The current default volume reference number and directory ID are
809 returned in oldVRefNum and oldDir and must be used to restore the
810 default volume and directory to their previous state *as soon as
811 possible* with the RestoreDefault function. These two functions are
812 designed to be used as a wrapper around Standard I/O routines where
813 the location of the file is implied to be the default volume and
814 directory. In other words, this is how you should use these functions:
816 error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
817 if ( error == noErr )
819 // call the Stdio functions like remove, rename, tmpfile,
820 // fopen, freopen, etc. or non-ANSI extensions like
821 // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
823 error = RestoreDefault(oldVRefNum, oldDirID);
826 By using these functions as a wrapper, you won't need to open a working
827 directory (because SetDefault and RestoreDefault use HSetVol) and you
828 won't have to worry about the effects of using HSetVol (documented in
829 Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
830 Inside Macintosh: Files book in the description of the HSetVol and
831 PBHSetVol functions) because the default volume/directory is restored
832 before giving up control to code that might be affected by HSetVol.
834 newVRefNum input: Volume specification (volume reference number,
835 working directory number, drive number, or 0) of
836 the new default volume.
837 newDirID input: Directory ID of the new default directory.
838 oldVRefNum output: The volume specification to save for use with
840 oldDirID output: The directory ID to save for use with
845 nsvErr -35 No such volume
846 bdNamErr -37 Bad volume name
847 fnfErr -43 Directory not found
848 paramErr -50 No default volume
849 afpAccessDenied -5000 User does not have access to the directory
853 Also see: RestoreDefault
856 /*****************************************************************************/
858 pascal OSErr
RestoreDefault(short oldVRefNum
,
860 /* ¦ Restore the default volume after making Standard C I/O requests.
861 The RestoreDefault function restores the default volume and directory
862 to the volume specified by oldVRefNum and the directory specified by
863 oldDirID. The oldVRefNum and oldDirID parameters were previously
864 obtained from the SetDefault function. These two functions are designed
865 to be used as a wrapper around Standard C I/O routines where the
866 location of the file is implied to be the default volume and directory.
867 In other words, this is how you should use these functions:
869 error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
870 if ( error == noErr )
872 // call the Stdio functions like remove, rename, tmpfile,
873 // fopen, freopen, etc. or non-ANSI extensions like
874 // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
876 error = RestoreDefault(oldVRefNum, oldDirID);
879 By using these functions as a wrapper, you won't need to open a working
880 directory (because SetDefault and RestoreDefault use HSetVol) and you
881 won't have to worry about the effects of using HSetVol (documented in
882 Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
883 Inside Macintosh: Files book in the description of the HSetVol and
884 PBHSetVol functions) because the default volume/directory is restored
885 before giving up control to code that might be affected by HSetVol.
887 oldVRefNum input: The volume specification to restore.
888 oldDirID input: The directory ID to restore.
892 nsvErr -35 No such volume
893 bdNamErr -37 Bad volume name
894 fnfErr -43 Directory not found
895 paramErr -50 No default volume
896 rfNumErr -51 Bad working directory reference number
897 afpAccessDenied -5000 User does not have access to the directory
904 /*****************************************************************************/
906 pascal OSErr
GetDInfo(short vRefNum
,
908 ConstStr255Param name
,
910 /* ¦ Get the finder information for a directory.
911 The GetDInfo function gets the finder information for a directory.
913 vRefNum input: Volume specification.
914 dirID input: Directory ID.
915 name input: Pointer to object name, or nil when dirID
916 specifies a directory that's the object.
917 fndrInfo output: If the object is a directory, then its DInfo.
921 nsvErr -35 No such volume
923 bdNamErr -37 Bad filename
924 fnfErr -43 File not found
925 paramErr -50 No default volume
926 dirNFErr -120 Directory not found or incomplete pathname
927 afpAccessDenied -5000 User does not have the correct access
928 afpObjectTypeErr -5025 Directory not found or incomplete pathname
932 Also see: FSpGetDInfo, FSpGetFInfoCompat
935 /*****************************************************************************/
937 pascal OSErr
FSpGetDInfo(const FSSpec
*spec
,
939 /* ¦ Get the finder information for a directory.
940 The FSpGetDInfo function gets the finder information for a directory.
942 spec input: An FSSpec record specifying the directory.
943 fndrInfo output: If the object is a directory, then its DInfo.
947 nsvErr -35 No such volume
949 bdNamErr -37 Bad filename
950 fnfErr -43 File not found
951 paramErr -50 No default volume
952 dirNFErr -120 Directory not found or incomplete pathname
953 afpAccessDenied -5000 User does not have the correct access
954 afpObjectTypeErr -5025 Directory not found or incomplete pathname
958 Also see: FSpGetFInfoCompat, GetDInfo
961 /*****************************************************************************/
963 pascal OSErr
SetDInfo(short vRefNum
,
965 ConstStr255Param name
,
966 const DInfo
*fndrInfo
);
967 /* ¦ Set the finder information for a directory.
968 The SetDInfo function sets the finder information for a directory.
970 vRefNum input: Volume specification.
971 dirID input: Directory ID.
972 name input: Pointer to object name, or nil when dirID
973 specifies a directory that's the object.
974 fndrInfo input: The DInfo.
978 nsvErr -35 No such volume
980 bdNamErr -37 Bad filename
981 fnfErr -43 File not found
982 fLckdErr -45 File is locked
983 vLckdErr -46 Volume is locked or read-only
984 paramErr -50 No default volume
985 dirNFErr -120 Directory not found or incomplete pathname
986 afpAccessDenied -5000 User does not have the correct access
987 afpObjectTypeErr -5025 Directory not found or incomplete pathname
991 Also see: FSpSetDInfo, FSpSetFInfoCompat
994 /*****************************************************************************/
996 pascal OSErr
FSpSetDInfo(const FSSpec
*spec
,
997 const DInfo
*fndrInfo
);
998 /* ¦ Set the finder information for a directory.
999 The FSpSetDInfo function sets the finder information for a directory.
1001 spec input: An FSSpec record specifying the directory.
1002 fndrInfo input: The DInfo.
1006 nsvErr -35 No such volume
1008 bdNamErr -37 Bad filename
1009 fnfErr -43 File not found
1010 fLckdErr -45 File is locked
1011 vLckdErr -46 Volume is locked or read-only
1012 paramErr -50 No default volume
1013 dirNFErr -120 Directory not found or incomplete pathname
1014 afpAccessDenied -5000 User does not have the correct access
1015 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1019 Also see: FSpSetFInfoCompat, SetDInfo
1022 /*****************************************************************************/
1025 #define GetDirID(vRefNum, dirID, name, theDirID, isDirectory) \
1026 GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory)
1029 pascal OSErr
GetDirectoryID(short vRefNum
,
1031 ConstStr255Param name
,
1033 Boolean
*isDirectory
);
1034 /* ¦ Get the directory ID number of the directory specified.
1035 The GetDirectoryID function gets the directory ID number of the
1036 directory specified. If a file is specified, then the parent
1037 directory of the file is returned and isDirectory is false. If
1038 a directory is specified, then that directory's ID number is
1039 returned and isDirectory is true.
1040 WARNING: Volume names on the Macintosh are *not* unique -- Multiple
1041 mounted volumes can have the same name. For this reason, the use of a
1042 volume name or full pathname to identify a specific volume may not
1043 produce the results you expect. If more than one volume has the same
1044 name and a volume name or full pathname is used, the File Manager
1045 currently uses the first volume it finds with a matching name in the
1048 vRefNum input: Volume specification.
1049 dirID input: Directory ID.
1050 name input: Pointer to object name, or nil when dirID
1051 specifies a directory that's the object.
1052 theDirID output: If the object is a file, then its parent directory
1053 ID. If the object is a directory, then its ID.
1054 isDirectory output: True if object is a directory; false if
1059 nsvErr -35 No such volume
1061 bdNamErr -37 Bad filename
1062 fnfErr -43 File not found
1063 paramErr -50 No default volume
1064 dirNFErr -120 Directory not found or incomplete pathname
1065 afpAccessDenied -5000 User does not have the correct access
1066 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1069 /*****************************************************************************/
1072 #define DirIDFromFSSpec(spec, theDirID, isDirectory) \
1073 FSpGetDirectoryID(spec, theDirID, isDirectory)
1076 pascal OSErr
FSpGetDirectoryID(const FSSpec
*spec
,
1078 Boolean
*isDirectory
);
1079 /* ¦ Get the directory ID number of a directory.
1080 The FSpGetDirectoryID function gets the directory ID number of the
1081 directory specified by spec. If spec is to a file, then the parent
1082 directory of the file is returned and isDirectory is false. If
1083 spec is to a directory, then that directory's ID number is
1084 returned and isDirectory is true.
1086 spec input: An FSSpec record specifying the directory.
1087 theDirID output: The directory ID.
1088 isDirectory output: True if object is a directory; false if
1093 nsvErr -35 No such volume
1095 bdNamErr -37 Bad filename
1096 fnfErr -43 File not found
1097 paramErr -50 No default volume
1098 dirNFErr -120 Directory not found or incomplete pathname
1099 afpAccessDenied -5000 User does not have the correct access
1100 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1103 /*****************************************************************************/
1105 pascal OSErr
GetDirName(short vRefNum
,
1108 /* ¦ Get the name of a directory from its directory ID.
1109 The GetDirName function gets the name of a directory from its
1112 vRefNum input: Volume specification.
1113 dirID input: Directory ID.
1114 name output: Points to a Str31 where the directory name is to be
1119 nsvErr -35 No such volume
1121 bdNamErr -37 Bad filename
1122 fnfErr -43 File not found
1123 paramErr -50 No default volume or
1124 name parameter was NULL
1125 dirNFErr -120 Directory not found or incomplete pathname
1126 afpAccessDenied -5000 User does not have the correct access
1127 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1130 /*****************************************************************************/
1132 pascal OSErr
GetIOACUser(short vRefNum
,
1134 ConstStr255Param name
,
1136 /* ¦ Get a directory's access restrictions byte.
1137 GetIOACUser returns a directory's access restrictions byte.
1138 Use the masks and macro defined in MoreFilesExtras to check for
1139 specific access priviledges.
1141 vRefNum input: Volume specification.
1142 dirID input: Directory ID.
1143 name input: Pointer to object name, or nil when dirID
1144 specifies a directory that's the object.
1145 ioACUser output: The access restriction byte
1149 nsvErr -35 No such volume
1151 bdNamErr -37 Bad filename
1152 fnfErr -43 File not found
1153 paramErr -50 No default volume
1154 dirNFErr -120 Directory not found or incomplete pathname
1155 afpAccessDenied -5000 User does not have the correct access
1156 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1159 /*****************************************************************************/
1161 pascal OSErr
FSpGetIOACUser(const FSSpec
*spec
,
1163 /* ¦ Get a directory's access restrictions byte.
1164 FSpGetIOACUser returns a directory's access restrictions byte.
1165 Use the masks and macro defined in MoreFilesExtras to check for
1166 specific access priviledges.
1168 spec input: An FSSpec record specifying the directory.
1169 ioACUser output: The access restriction byte
1173 nsvErr -35 No such volume
1175 bdNamErr -37 Bad filename
1176 fnfErr -43 File not found
1177 paramErr -50 No default volume
1178 dirNFErr -120 Directory not found or incomplete pathname
1179 afpAccessDenied -5000 User does not have the correct access
1180 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1183 /*****************************************************************************/
1185 pascal OSErr
GetParentID(short vRefNum
,
1187 ConstStr255Param name
,
1189 /* ¦ Get the parent directory ID number of the specified object.
1190 The GetParentID function gets the parent directory ID number of the
1193 vRefNum input: Volume specification.
1194 dirID input: Directory ID.
1195 name input: Pointer to object name, or nil when dirID specifies
1196 a directory that's the object.
1197 parID output: The parent directory ID of the specified object.
1201 nsvErr -35 No such volume
1203 bdNamErr -37 Bad filename
1204 fnfErr -43 File not found
1205 paramErr -50 No default volume
1206 dirNFErr -120 Directory not found or incomplete pathname
1207 afpAccessDenied -5000 User does not have the correct access
1208 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1211 /*****************************************************************************/
1213 pascal OSErr
GetFilenameFromPathname(ConstStr255Param pathname
,
1215 /* ¦ Get the object name from the end of a full or partial pathname.
1216 The GetFilenameFromPathname function gets the file (or directory) name
1217 from the end of a full or partial pathname. Returns notAFileErr if the
1218 pathname is nil, the pathname is empty, or the pathname cannot refer to
1219 a filename (with a noErr result, the pathname could still refer to a
1222 pathname input: A full or partial pathname.
1223 filename output: The file (or directory) name.
1227 notAFileErr -1302 The pathname is nil, the pathname
1228 is empty, or the pathname cannot refer
1233 See also: GetObjectLocation.
1236 /*****************************************************************************/
1238 pascal OSErr
GetObjectLocation(short vRefNum
,
1240 ConstStr255Param pathname
,
1244 Boolean
*isDirectory
);
1245 /* ¦ Get a file system object's location.
1246 The GetObjectLocation function gets a file system object's location -
1247 that is, its real volume reference number, real parent directory ID,
1248 and name. While we're at it, determine if the object is a file or directory.
1249 If GetObjectLocation returns fnfErr, then the location information
1250 returned is valid, but it describes an object that doesn't exist.
1251 You can use the location information for another operation, such as
1252 creating a file or directory.
1254 vRefNum input: Volume specification.
1255 dirID input: Directory ID.
1256 pathname input: Pointer to object name, or nil when dirID specifies
1257 a directory that's the object.
1258 realVRefNum output: The real volume reference number.
1259 realParID output: The parent directory ID of the specified object.
1260 realName output: The name of the specified object (the case of the
1261 object name may not be the same as the object's
1262 catalog entry on disk - since the Macintosh file
1263 system is not case sensitive, it shouldn't matter).
1264 isDirectory output: True if object is a directory; false if object
1269 nsvErr -35 No such volume
1271 bdNamErr -37 Bad filename
1272 fnfErr -43 File not found
1273 paramErr -50 No default volume
1274 dirNFErr -120 Directory not found or incomplete pathname
1275 notAFileErr -1302 The pathname is nil, the pathname
1276 is empty, or the pathname cannot refer
1278 afpAccessDenied -5000 User does not have the correct access
1279 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1283 See also: FSMakeFSSpecCompat
1286 /*****************************************************************************/
1288 pascal OSErr
GetDirItems(short vRefNum
,
1290 ConstStr255Param name
,
1292 Boolean getDirectories
,
1295 short *actItemCount
,
1297 /* ¦ Return a list of items in a directory.
1298 The GetDirItems function returns a list of items in the specified
1299 directory in an array of FSSpec records. File, subdirectories, or
1300 both can be returned in the list.
1302 A noErr result indicates that the items array was filled
1303 (actItemCount == reqItemCount) and there may be additional items
1304 left in the directory. A fnfErr result indicates that the end of
1305 the directory list was found and actItemCount items were actually
1308 vRefNum input: Volume specification.
1309 dirID input: Directory ID.
1310 name input: Pointer to object name, or nil when dirID
1311 specifies a directory that's the object.
1312 getFiles input: Pass true to have files added to the items list.
1313 getDirectories input: Pass true to have directories added to the
1315 items input: Pointer to array of FSSpec where the item list
1317 reqItemCount input: Maximum number of items to return (the number
1318 of elements in the items array).
1319 actItemCount output: The number of items actually returned.
1320 itemIndex input: The current item index position. Set to 1 to
1321 start with the first item in the directory.
1322 output: The item index position to get the next item.
1323 Pass this value the next time you call
1324 GetDirItems to start where you left off.
1327 noErr 0 No error, but there are more items
1329 nsvErr -35 No such volume
1331 bdNamErr -37 Bad filename
1332 fnfErr -43 File not found, there are no more items
1334 paramErr -50 No default volume or itemIndex was <= 0
1335 dirNFErr -120 Directory not found or incomplete pathname
1336 afpAccessDenied -5000 User does not have the correct access
1337 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1340 /*****************************************************************************/
1342 pascal OSErr
DeleteDirectoryContents(short vRefNum
,
1344 ConstStr255Param name
);
1345 /* ¦ Delete the contents of a directory.
1346 The DeleteDirectoryContents function deletes the contents of a directory.
1347 All files and subdirectories in the specified directory are deleted.
1348 If a locked file or directory is encountered, it is unlocked and then
1349 deleted. If any unexpected errors are encountered,
1350 DeleteDirectoryContents quits and returns to the caller.
1352 vRefNum input: Volume specification.
1353 dirID input: Directory ID.
1354 name input: Pointer to directory name, or nil when dirID specifies
1355 a directory that's the object.
1359 nsvErr -35 No such volume
1361 bdNamErr -37 Bad filename
1362 fnfErr -43 File not found
1363 wPrErr -44 Hardware volume lock
1364 fLckdErr -45 File is locked
1365 vLckdErr -46 Software volume lock
1366 fBsyErr -47 File busy, directory not empty, or working directory control block open
1367 paramErr -50 No default volume
1368 dirNFErr -120 Directory not found or incomplete pathname
1369 afpAccessDenied -5000 User does not have the correct access
1370 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1374 Also see: DeleteDirectory
1377 /*****************************************************************************/
1379 pascal OSErr
DeleteDirectory(short vRefNum
,
1381 ConstStr255Param name
);
1382 /* ¦ Delete a directory and its contents.
1383 The DeleteDirectory function deletes a directory and its contents.
1384 All files and subdirectories in the specified directory are deleted.
1385 If a locked file or directory is encountered, it is unlocked and then
1386 deleted. After deleting the directories contents, the directory is
1387 deleted. If any unexpected errors are encountered, DeleteDirectory
1388 quits and returns to the caller.
1390 vRefNum input: Volume specification.
1391 dirID input: Directory ID.
1392 name input: Pointer to directory name, or nil when dirID specifies
1393 a directory that's the object.
1397 nsvErr -35 No such volume
1399 bdNamErr -37 Bad filename
1400 fnfErr -43 File not found
1401 wPrErr -44 Hardware volume lock
1402 fLckdErr -45 File is locked
1403 vLckdErr -46 Software volume lock
1404 fBsyErr -47 File busy, directory not empty, or working directory control block open
1405 paramErr -50 No default volume
1406 dirNFErr -120 Directory not found or incomplete pathname
1407 afpAccessDenied -5000 User does not have the correct access
1408 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1412 Also see: DeleteDirectoryContents
1415 /*****************************************************************************/
1417 pascal OSErr
CheckObjectLock(short vRefNum
,
1419 ConstStr255Param name
);
1420 /* ¦ Determine if a file or directory is locked.
1421 The CheckObjectLock function determines if a file or directory is locked.
1422 If CheckObjectLock returns noErr, then the file or directory
1423 is not locked. If CheckObjectLock returns fLckdErr, the it is locked.
1425 vRefNum input: Volume specification.
1426 dirID input: Directory ID.
1427 name input: Pointer to object name, or nil when dirID specifies
1428 a directory that's the object.
1432 nsvErr -35 No such volume
1434 bdNamErr -37 Bad filename
1435 fnfErr -43 File not found
1436 fLckdErr -45 File is locked
1437 paramErr -50 No default volume
1438 dirNFErr -120 Directory not found or incomplete pathname
1439 afpAccessDenied -5000 User does not have the correct access
1440 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1444 Also see: FSpCheckObjectLock
1447 /*****************************************************************************/
1449 pascal OSErr
FSpCheckObjectLock(const FSSpec
*spec
);
1450 /* ¦ Determine if a file or directory is locked.
1451 The FSpCheckObjectLock function determines if a file or directory is locked.
1452 If FSpCheckObjectLock returns noErr, then the file or directory
1455 spec input: An FSSpec record specifying the object.
1459 nsvErr -35 No such volume
1461 bdNamErr -37 Bad filename
1462 fnfErr -43 File not found
1463 fLckdErr -45 File is locked
1464 paramErr -50 No default volume
1465 dirNFErr -120 Directory not found or incomplete pathname
1466 afpAccessDenied -5000 User does not have the correct access
1467 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1471 Also see: CheckObjectLock
1474 /*****************************************************************************/
1476 pascal OSErr
GetFileSize(short vRefNum
,
1478 ConstStr255Param fileName
,
1481 /* ¦ Get the logical sizes of a file's forks.
1482 The GetFileSize function returns the logical size of a file's
1483 data and resource fork.
1485 vRefNum input: Volume specification.
1486 dirID input: Directory ID.
1487 name input: The name of the file.
1488 dataSize output: The number of bytes in the file's data fork.
1489 rsrcSize output: The number of bytes in the file's resource fork.
1493 nsvErr -35 No such volume
1495 bdNamErr -37 Bad filename
1496 fnfErr -43 File not found
1497 paramErr -50 No default volume
1498 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
1499 afpAccessDenied -5000 User does not have the correct access
1500 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1504 See also: FSpGetFileSize
1507 /*****************************************************************************/
1509 pascal OSErr
FSpGetFileSize(const FSSpec
*spec
,
1512 /* ¦ Get the logical sizes of a file's forks.
1513 The FSpGetFileSize function returns the logical size of a file's
1514 data and resource fork.
1516 spec input: An FSSpec record specifying the file.
1517 dataSize output: The number of bytes in the file's data fork.
1518 rsrcSize output: The number of bytes in the file's resource fork.
1522 nsvErr -35 No such volume
1524 bdNamErr -37 Bad filename
1525 fnfErr -43 File not found
1526 paramErr -50 No default volume
1527 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
1528 afpAccessDenied -5000 User does not have the correct access
1529 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1533 See also: GetFileSize
1536 /*****************************************************************************/
1538 pascal OSErr
BumpDate(short vRefNum
,
1540 ConstStr255Param name
);
1541 /* ¦ Update the modification date of a file or directory.
1542 The BumpDate function changes the modification date of a file or
1543 directory to the current date/time. If the modification date is already
1544 equal to the current date/time, then add one second to the
1547 vRefNum input: Volume specification.
1548 dirID input: Directory ID.
1549 name input: Pointer to object name, or nil when dirID specifies
1550 a directory that's the object.
1554 nsvErr -35 No such volume
1556 bdNamErr -37 Bad filename
1557 fnfErr -43 File not found
1558 fLckdErr -45 File is locked
1559 vLckdErr -46 Volume is locked or read-only
1560 paramErr -50 No default volume
1561 dirNFErr -120 Directory not found or incomplete pathname
1562 afpAccessDenied -5000 User does not have the correct access
1563 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1567 See also: FSpBumpDate
1570 /*****************************************************************************/
1572 pascal OSErr
FSpBumpDate(const FSSpec
*spec
);
1573 /* ¦ Update the modification date of a file or directory.
1574 The FSpBumpDate function changes the modification date of a file or
1575 directory to the current date/time. If the modification date is already
1576 equal to the current date/time, then add one second to the
1579 spec input: An FSSpec record specifying the object.
1583 nsvErr -35 No such volume
1585 bdNamErr -37 Bad filename
1586 fnfErr -43 File not found
1587 fLckdErr -45 File is locked
1588 vLckdErr -46 Volume is locked or read-only
1589 paramErr -50 No default volume
1590 dirNFErr -120 Directory not found or incomplete pathname
1591 afpAccessDenied -5000 User does not have the correct access
1592 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1599 /*****************************************************************************/
1601 pascal OSErr
ChangeCreatorType(short vRefNum
,
1603 ConstStr255Param name
,
1606 /* ¦ Change the creator or file type of a file.
1607 The ChangeCreatorType function changes the creator or file type of a file.
1609 vRefNum input: Volume specification.
1610 dirID input: Directory ID.
1611 name input: The name of the file.
1612 creator input: The new creator type or 0x00000000 to leave
1613 the creator type alone.
1614 fileType input: The new file type or 0x00000000 to leave the
1619 nsvErr -35 No such volume
1621 bdNamErr -37 Bad filename
1622 fnfErr -43 File not found
1623 fLckdErr -45 File is locked
1624 vLckdErr -46 Volume is locked or read-only
1625 paramErr -50 No default volume
1626 dirNFErr -120 Directory not found or incomplete pathname
1627 notAFileErr -1302 Name was not a file
1628 afpAccessDenied -5000 User does not have the correct access
1629 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1633 See also: FSpChangeCreatorType
1636 /*****************************************************************************/
1638 pascal OSErr
FSpChangeCreatorType(const FSSpec
*spec
,
1641 /* ¦ Change the creator or file type of a file.
1642 The FSpChangeCreatorType function changes the creator or file type of a file.
1644 spec input: An FSSpec record specifying the file.
1645 creator input: The new creator type or 0x00000000 to leave
1646 the creator type alone.
1647 fileType input: The new file type or 0x00000000 to leave the
1652 nsvErr -35 No such volume
1654 bdNamErr -37 Bad filename
1655 fnfErr -43 File not found
1656 fLckdErr -45 File is locked
1657 vLckdErr -46 Volume is locked or read-only
1658 paramErr -50 No default volume
1659 dirNFErr -120 Directory not found or incomplete pathname
1660 notAFileErr -1302 Name was not a file
1661 afpAccessDenied -5000 User does not have the correct access
1662 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1666 See also: ChangeCreatorType
1669 /*****************************************************************************/
1671 pascal OSErr
ChangeFDFlags(short vRefNum
,
1673 ConstStr255Param name
,
1675 unsigned short flagBits
);
1676 /* ¦ Set or clear Finder Flag bits.
1677 The ChangeFDFlags function sets or clears Finder Flag bits in the
1678 fdFlags field of a file or directory's FInfo record.
1680 vRefNum input: Volume specification.
1681 dirID input: Directory ID.
1682 name input: Pointer to object name, or nil when dirID specifies
1683 a directory that's the object.
1684 setBits input: If true, then set the bits specified in flagBits.
1685 If false, then clear the bits specified in flagBits.
1686 flagBits input: The flagBits parameter specifies which Finder Flag
1687 bits to set or clear. If a bit in flagBits is set,
1688 then the same bit in fdFlags is either set or
1689 cleared depending on the state of the setBits
1694 nsvErr -35 No such volume
1696 bdNamErr -37 Bad filename
1697 fnfErr -43 File not found
1698 fLckdErr -45 File is locked
1699 vLckdErr -46 Volume is locked or read-only
1700 paramErr -50 No default volume
1701 dirNFErr -120 Directory not found or incomplete pathname
1702 afpAccessDenied -5000 User does not have the correct access
1703 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1707 See also: FSpChangeFDFlags
1710 /*****************************************************************************/
1712 pascal OSErr
FSpChangeFDFlags(const FSSpec
*spec
,
1714 unsigned short flagBits
);
1715 /* ¦ Set or clear Finder Flag bits.
1716 The FSpChangeFDFlags function sets or clears Finder Flag bits in the
1717 fdFlags field of a file or directory's FInfo record.
1719 spec input: An FSSpec record specifying the object.
1720 setBits input: If true, then set the bits specified in flagBits.
1721 If false, then clear the bits specified in flagBits.
1722 flagBits input: The flagBits parameter specifies which Finder Flag
1723 bits to set or clear. If a bit in flagBits is set,
1724 then the same bit in fdFlags is either set or
1725 cleared depending on the state of the setBits
1730 nsvErr -35 No such volume
1732 bdNamErr -37 Bad filename
1733 fnfErr -43 File not found
1734 fLckdErr -45 File is locked
1735 vLckdErr -46 Volume is locked or read-only
1736 paramErr -50 No default volume
1737 dirNFErr -120 Directory not found or incomplete pathname
1738 afpAccessDenied -5000 User does not have the correct access
1739 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1743 See also: ChangeFDFlags
1746 /*****************************************************************************/
1748 pascal OSErr
SetIsInvisible(short vRefNum
,
1750 ConstStr255Param name
);
1751 /* ¦ Set the invisible Finder Flag bit.
1752 The SetIsInvisible function sets the invisible bit in the fdFlags
1753 word of the specified file or directory's finder information.
1755 vRefNum input: Volume specification.
1756 dirID input: Directory ID.
1757 name input: Pointer to object name, or nil when dirID specifies
1758 a directory that's the object.
1762 nsvErr -35 No such volume
1764 bdNamErr -37 Bad filename
1765 fnfErr -43 File not found
1766 fLckdErr -45 File is locked
1767 vLckdErr -46 Volume is locked or read-only
1768 paramErr -50 No default volume
1769 dirNFErr -120 Directory not found or incomplete pathname
1770 afpAccessDenied -5000 User does not have the correct access
1771 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1775 See also: FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
1778 /*****************************************************************************/
1780 pascal OSErr
FSpSetIsInvisible(const FSSpec
*spec
);
1781 /* ¦ Set the invisible Finder Flag bit.
1782 The FSpSetIsInvisible function sets the invisible bit in the fdFlags
1783 word of the specified file or directory's finder information.
1785 spec input: An FSSpec record specifying the object.
1789 nsvErr -35 No such volume
1791 bdNamErr -37 Bad filename
1792 fnfErr -43 File not found
1793 fLckdErr -45 File is locked
1794 vLckdErr -46 Volume is locked or read-only
1795 paramErr -50 No default volume
1796 dirNFErr -120 Directory not found or incomplete pathname
1797 afpAccessDenied -5000 User does not have the correct access
1798 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1802 See also: SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
1805 /*****************************************************************************/
1807 pascal OSErr
ClearIsInvisible(short vRefNum
,
1809 ConstStr255Param name
);
1810 /* ¦ Clear the invisible Finder Flag bit.
1811 The ClearIsInvisible function clears the invisible bit in the fdFlags
1812 word of the specified file or directory's finder information.
1814 vRefNum input: Volume specification.
1815 dirID input: Directory ID.
1816 name input: Pointer to object name, or nil when dirID specifies
1817 a directory that's the object.
1821 nsvErr -35 No such volume
1823 bdNamErr -37 Bad filename
1824 fnfErr -43 File not found
1825 fLckdErr -45 File is locked
1826 vLckdErr -46 Volume is locked or read-only
1827 paramErr -50 No default volume
1828 dirNFErr -120 Directory not found or incomplete pathname
1829 afpAccessDenied -5000 User does not have the correct access
1830 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1834 See also: SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
1837 /*****************************************************************************/
1839 pascal OSErr
FSpClearIsInvisible(const FSSpec
*spec
);
1840 /* ¦ Clear the invisible Finder Flag bit.
1841 The FSpClearIsInvisible function clears the invisible bit in the fdFlags
1842 word of the specified file or directory's finder information.
1844 spec input: An FSSpec record specifying the object.
1848 nsvErr -35 No such volume
1850 bdNamErr -37 Bad filename
1851 fnfErr -43 File not found
1852 fLckdErr -45 File is locked
1853 vLckdErr -46 Volume is locked or read-only
1854 paramErr -50 No default volume
1855 dirNFErr -120 Directory not found or incomplete pathname
1856 afpAccessDenied -5000 User does not have the correct access
1857 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1861 See also: SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
1864 /*****************************************************************************/
1866 pascal OSErr
SetNameLocked(short vRefNum
,
1868 ConstStr255Param name
);
1869 /* ¦ Set the nameLocked Finder Flag bit.
1870 The SetNameLocked function sets the nameLocked bit in the fdFlags word
1871 of the specified file or directory's finder information.
1873 vRefNum input: Volume specification.
1874 dirID input: Directory ID.
1875 name input: Pointer to object name, or nil when dirID specifies
1876 a directory that's the object.
1880 nsvErr -35 No such volume
1882 bdNamErr -37 Bad filename
1883 fnfErr -43 File not found
1884 fLckdErr -45 File is locked
1885 vLckdErr -46 Volume is locked or read-only
1886 paramErr -50 No default volume
1887 dirNFErr -120 Directory not found or incomplete pathname
1888 afpAccessDenied -5000 User does not have the correct access
1889 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1893 See also: FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
1896 /*****************************************************************************/
1898 pascal OSErr
FSpSetNameLocked(const FSSpec
*spec
);
1899 /* ¦ Set the nameLocked Finder Flag bit.
1900 The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
1901 of the specified file or directory's finder information.
1903 spec input: An FSSpec record specifying the object.
1907 nsvErr -35 No such volume
1909 bdNamErr -37 Bad filename
1910 fnfErr -43 File not found
1911 fLckdErr -45 File is locked
1912 vLckdErr -46 Volume is locked or read-only
1913 paramErr -50 No default volume
1914 dirNFErr -120 Directory not found or incomplete pathname
1915 afpAccessDenied -5000 User does not have the correct access
1916 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1920 See also: SetNameLocked, ClearNameLocked, FSpClearNameLocked
1923 /*****************************************************************************/
1925 pascal OSErr
ClearNameLocked(short vRefNum
,
1927 ConstStr255Param name
);
1928 /* ¦ Clear the nameLocked Finder Flag bit.
1929 The ClearNameLocked function clears the nameLocked bit in the fdFlags
1930 word of the specified file or directory's finder information.
1932 vRefNum input: Volume specification.
1933 dirID input: Directory ID.
1934 name input: Pointer to object name, or nil when dirID specifies
1935 a directory that's the object.
1939 nsvErr -35 No such volume
1941 bdNamErr -37 Bad filename
1942 fnfErr -43 File not found
1943 fLckdErr -45 File is locked
1944 vLckdErr -46 Volume is locked or read-only
1945 paramErr -50 No default volume
1946 dirNFErr -120 Directory not found or incomplete pathname
1947 afpAccessDenied -5000 User does not have the correct access
1948 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1952 See also: SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
1955 /*****************************************************************************/
1957 pascal OSErr
FSpClearNameLocked(const FSSpec
*spec
);
1958 /* ¦ Clear the nameLocked Finder Flag bit.
1959 The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
1960 word of the specified file or directory's finder information.
1962 spec input: An FSSpec record specifying the object.
1966 nsvErr -35 No such volume
1968 bdNamErr -37 Bad filename
1969 fnfErr -43 File not found
1970 fLckdErr -45 File is locked
1971 vLckdErr -46 Volume is locked or read-only
1972 paramErr -50 No default volume
1973 dirNFErr -120 Directory not found or incomplete pathname
1974 afpAccessDenied -5000 User does not have the correct access
1975 afpObjectTypeErr -5025 Directory not found or incomplete pathname
1979 See also: SetNameLocked, FSpSetNameLocked, ClearNameLocked
1982 /*****************************************************************************/
1984 pascal OSErr
SetIsStationery(short vRefNum
,
1986 ConstStr255Param name
);
1987 /* ¦ Set the isStationery Finder Flag bit.
1988 The SetIsStationery function sets the isStationery bit in the
1989 fdFlags word of the specified file or directory's finder information.
1991 vRefNum input: Volume specification.
1992 dirID input: Directory ID.
1993 name input: Pointer to object name, or nil when dirID specifies
1994 a directory that's the object.
1998 nsvErr -35 No such volume
2000 bdNamErr -37 Bad filename
2001 fnfErr -43 File not found
2002 fLckdErr -45 File is locked
2003 vLckdErr -46 Volume is locked or read-only
2004 paramErr -50 No default volume
2005 dirNFErr -120 Directory not found or incomplete pathname
2006 afpAccessDenied -5000 User does not have the correct access
2007 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2011 See also: FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
2014 /*****************************************************************************/
2016 pascal OSErr
FSpSetIsStationery(const FSSpec
*spec
);
2017 /* ¦ Set the isStationery Finder Flag bit.
2018 The FSpSetIsStationery function sets the isStationery bit in the
2019 fdFlags word of the specified file or directory's finder information.
2021 spec input: An FSSpec record specifying the object.
2025 nsvErr -35 No such volume
2027 bdNamErr -37 Bad filename
2028 fnfErr -43 File not found
2029 fLckdErr -45 File is locked
2030 vLckdErr -46 Volume is locked or read-only
2031 paramErr -50 No default volume
2032 dirNFErr -120 Directory not found or incomplete pathname
2033 afpAccessDenied -5000 User does not have the correct access
2034 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2038 See also: SetIsStationery, ClearIsStationery, FSpClearIsStationery
2041 /*****************************************************************************/
2043 pascal OSErr
ClearIsStationery(short vRefNum
,
2045 ConstStr255Param name
);
2046 /* ¦ Clear the isStationery Finder Flag bit.
2047 The ClearIsStationery function clears the isStationery bit in the
2048 fdFlags word of the specified file or directory's finder information.
2050 vRefNum input: Volume specification.
2051 dirID input: Directory ID.
2052 name input: Pointer to object name, or nil when dirID specifies
2053 a directory that's the object.
2057 nsvErr -35 No such volume
2059 bdNamErr -37 Bad filename
2060 fnfErr -43 File not found
2061 fLckdErr -45 File is locked
2062 vLckdErr -46 Volume is locked or read-only
2063 paramErr -50 No default volume
2064 dirNFErr -120 Directory not found or incomplete pathname
2065 afpAccessDenied -5000 User does not have the correct access
2066 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2070 See also: SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
2073 /*****************************************************************************/
2075 pascal OSErr
FSpClearIsStationery(const FSSpec
*spec
);
2076 /* ¦ Clear the isStationery Finder Flag bit.
2077 The FSpClearIsStationery function clears the isStationery bit in the
2078 fdFlags word of the specified file or directory's finder information.
2080 spec input: An FSSpec record specifying the object.
2084 nsvErr -35 No such volume
2086 bdNamErr -37 Bad filename
2087 fnfErr -43 File not found
2088 fLckdErr -45 File is locked
2089 vLckdErr -46 Volume is locked or read-only
2090 paramErr -50 No default volume
2091 dirNFErr -120 Directory not found or incomplete pathname
2092 afpAccessDenied -5000 User does not have the correct access
2093 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2097 See also: SetIsStationery, FSpSetIsStationery, ClearIsStationery
2100 /*****************************************************************************/
2102 pascal OSErr
SetHasCustomIcon(short vRefNum
,
2104 ConstStr255Param name
);
2105 /* ¦ Set the hasCustomIcon Finder Flag bit.
2106 The SetHasCustomIcon function sets the hasCustomIcon bit in the
2107 fdFlags word of the specified file or directory's finder information.
2109 vRefNum input: Volume specification.
2110 dirID input: Directory ID.
2111 name input: Pointer to object name, or nil when dirID specifies
2112 a directory that's the object.
2116 nsvErr -35 No such volume
2118 bdNamErr -37 Bad filename
2119 fnfErr -43 File not found
2120 fLckdErr -45 File is locked
2121 vLckdErr -46 Volume is locked or read-only
2122 paramErr -50 No default volume
2123 dirNFErr -120 Directory not found or incomplete pathname
2124 afpAccessDenied -5000 User does not have the correct access
2125 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2129 See also: FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
2132 /*****************************************************************************/
2134 pascal OSErr
FSpSetHasCustomIcon(const FSSpec
*spec
);
2135 /* ¦ Set the hasCustomIcon Finder Flag bit.
2136 The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
2137 fdFlags word of the specified file or directory's finder information.
2139 spec input: An FSSpec record specifying the object.
2143 nsvErr -35 No such volume
2145 bdNamErr -37 Bad filename
2146 fnfErr -43 File not found
2147 fLckdErr -45 File is locked
2148 vLckdErr -46 Volume is locked or read-only
2149 paramErr -50 No default volume
2150 dirNFErr -120 Directory not found or incomplete pathname
2151 afpAccessDenied -5000 User does not have the correct access
2152 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2156 See also: SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
2159 /*****************************************************************************/
2161 pascal OSErr
ClearHasCustomIcon(short vRefNum
,
2163 ConstStr255Param name
);
2164 /* ¦ Clear the hasCustomIcon Finder Flag bit.
2165 The ClearHasCustomIcon function clears the hasCustomIcon bit in the
2166 fdFlags word of the specified file or directory's finder information.
2168 vRefNum input: Volume specification.
2169 dirID input: Directory ID.
2170 name input: Pointer to object name, or nil when dirID specifies
2171 a directory that's the object.
2175 nsvErr -35 No such volume
2177 bdNamErr -37 Bad filename
2178 fnfErr -43 File not found
2179 fLckdErr -45 File is locked
2180 vLckdErr -46 Volume is locked or read-only
2181 paramErr -50 No default volume
2182 dirNFErr -120 Directory not found or incomplete pathname
2183 afpAccessDenied -5000 User does not have the correct access
2184 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2188 See also: SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
2191 /*****************************************************************************/
2193 pascal OSErr
FSpClearHasCustomIcon(const FSSpec
*spec
);
2194 /* ¦ Clear the hasCustomIcon Finder Flag bit.
2195 The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
2196 fdFlags word of the specified file or directory's finder information.
2198 spec input: An FSSpec record specifying the object.
2202 nsvErr -35 No such volume
2204 bdNamErr -37 Bad filename
2205 fnfErr -43 File not found
2206 fLckdErr -45 File is locked
2207 vLckdErr -46 Volume is locked or read-only
2208 paramErr -50 No default volume
2209 dirNFErr -120 Directory not found or incomplete pathname
2210 afpAccessDenied -5000 User does not have the correct access
2211 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2215 See also: SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
2218 /*****************************************************************************/
2220 pascal OSErr
ClearHasBeenInited(short vRefNum
,
2222 ConstStr255Param name
);
2223 /* ¦ Clear the hasBeenInited Finder Flag bit.
2224 The ClearHasBeenInited function clears the hasBeenInited bit in the
2225 fdFlags word of the specified file or directory's finder information.
2227 vRefNum input: Volume specification.
2228 dirID input: Directory ID.
2229 name input: Pointer to object name, or nil when dirID specifies
2230 a directory that's the object.
2234 nsvErr -35 No such volume
2236 bdNamErr -37 Bad filename
2237 fnfErr -43 File not found
2238 fLckdErr -45 File is locked
2239 vLckdErr -46 Volume is locked or read-only
2240 paramErr -50 No default volume
2241 dirNFErr -120 Directory not found or incomplete pathname
2242 afpAccessDenied -5000 User does not have the correct access
2243 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2247 See also: FSpClearHasBeenInited
2250 /*****************************************************************************/
2252 pascal OSErr
FSpClearHasBeenInited(const FSSpec
*spec
);
2253 /* ¦ Clear the hasBeenInited Finder Flag bit.
2254 The FSpClearHasBeenInited function clears the hasBeenInited bit in the
2255 fdFlags word of the specified file or directory's finder information.
2257 spec input: An FSSpec record specifying the object.
2261 nsvErr -35 No such volume
2263 bdNamErr -37 Bad filename
2264 fnfErr -43 File not found
2265 fLckdErr -45 File is locked
2266 vLckdErr -46 Volume is locked or read-only
2267 paramErr -50 No default volume
2268 dirNFErr -120 Directory not found or incomplete pathname
2269 afpAccessDenied -5000 User does not have the correct access
2270 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2274 See also: ClearHasBeenInited
2277 /*****************************************************************************/
2279 pascal OSErr
CopyFileMgrAttributes(short srcVRefNum
,
2281 ConstStr255Param srcName
,
2284 ConstStr255Param dstName
,
2285 Boolean copyLockBit
);
2286 /* ¦ Copy all File Manager attributes from the source to the destination.
2287 The CopyFileMgrAttributes function copies all File Manager attributes
2288 from the source file or directory to the destination file or directory.
2289 If copyLockBit is true, then set the locked state of the destination
2290 to match the source.
2292 srcVRefNum input: Source volume specification.
2293 srcDirID input: Source directory ID.
2294 srcName input: Pointer to source object name, or nil when
2295 srcDirID specifies a directory that's the object.
2296 dstVRefNum input: Destination volume specification.
2297 dstDirID input: Destination directory ID.
2298 dstName input: Pointer to destination object name, or nil when
2299 dstDirID specifies a directory that's the object.
2300 copyLockBit input: If true, set the locked state of the destination
2301 to match the source.
2305 nsvErr -35 No such volume
2307 bdNamErr -37 Bad filename
2308 fnfErr -43 File not found
2309 fLckdErr -45 File is locked
2310 vLckdErr -46 Volume is locked or read-only
2311 paramErr -50 No default volume
2312 dirNFErr -120 Directory not found or incomplete pathname
2313 afpAccessDenied -5000 User does not have the correct access
2314 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2318 See also: FSpCopyFileMgrAttributes
2321 /*****************************************************************************/
2323 pascal OSErr
FSpCopyFileMgrAttributes(const FSSpec
*srcSpec
,
2324 const FSSpec
*dstSpec
,
2325 Boolean copyLockBit
);
2326 /* ¦ Copy all File Manager attributes from the source to the destination.
2327 The FSpCopyFileMgrAttributes function copies all File Manager attributes
2328 from the source file or directory to the destination file or directory.
2329 If copyLockBit is true, then set the locked state of the destination
2330 to match the source.
2332 srcSpec input: An FSSpec record specifying the source object.
2333 dstSpec input: An FSSpec record specifying the destination object.
2334 copyLockBit input: If true, set the locked state of the destination
2335 to match the source.
2339 nsvErr -35 No such volume
2341 bdNamErr -37 Bad filename
2342 fnfErr -43 File not found
2343 fLckdErr -45 File is locked
2344 vLckdErr -46 Volume is locked or read-only
2345 paramErr -50 No default volume
2346 dirNFErr -120 Directory not found or incomplete pathname
2347 afpAccessDenied -5000 User does not have the correct access
2348 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2352 See also: CopyFileMgrAttributes
2355 /*****************************************************************************/
2357 pascal OSErr
HOpenAware(short vRefNum
,
2359 ConstStr255Param fileName
,
2362 /* ¦ Open the data fork of a file using deny mode permissions.
2363 The HOpenAware function opens the data fork of a file using deny mode
2364 permissions instead the normal File Manager permissions. If OpenDeny
2365 is not available, then HOpenAware translates the deny modes to the
2366 closest File Manager permissions and tries to open the file with
2367 OpenDF first, and then Open if OpenDF isn't available. By using
2368 HOpenAware with deny mode permissions, a program can be "AppleShare
2369 aware" and fall back on the standard File Manager open calls
2372 vRefNum input: Volume specification.
2373 dirID input: Directory ID.
2374 fileName input: The name of the file.
2375 denyModes input: The deny modes access under which to open the file.
2376 refNum output: The file reference number of the opened file.
2380 nsvErr -35 No such volume
2381 tmfoErr -42 Too many files open
2382 fnfErr -43 File not found
2383 wPrErr -44 Volume locked by hardware
2384 fLckdErr -45 File is locked
2385 vLckdErr -46 Volume is locked or read-only
2386 opWrErr -49 File already open for writing
2387 paramErr -50 No default volume
2388 permErr -54 File is already open and cannot be opened using specified deny modes
2389 afpAccessDenied -5000 User does not have the correct access to the file
2390 afpDenyConflict -5006 Requested access permission not possible
2394 See also: FSpOpenAware, HOpenRFAware, FSpOpenRFAware
2397 /*****************************************************************************/
2399 pascal OSErr
FSpOpenAware(const FSSpec
*spec
,
2402 /* ¦ Open the data fork of a file using deny mode permissions.
2403 The FSpOpenAware function opens the data fork of a file using deny mode
2404 permissions instead the normal File Manager permissions. If OpenDeny
2405 is not available, then FSpOpenAware translates the deny modes to the
2406 closest File Manager permissions and tries to open the file with
2407 OpenDF first, and then Open if OpenDF isn't available. By using
2408 FSpOpenAware with deny mode permissions, a program can be "AppleShare
2409 aware" and fall back on the standard File Manager open calls
2412 spec input: An FSSpec record specifying the file.
2413 denyModes input: The deny modes access under which to open the file.
2414 refNum output: The file reference number of the opened file.
2418 nsvErr -35 No such volume
2419 tmfoErr -42 Too many files open
2420 fnfErr -43 File not found
2421 wPrErr -44 Volume locked by hardware
2422 fLckdErr -45 File is locked
2423 vLckdErr -46 Volume is locked or read-only
2424 opWrErr -49 File already open for writing
2425 paramErr -50 No default volume
2426 permErr -54 File is already open and cannot be opened using specified deny modes
2427 afpAccessDenied -5000 User does not have the correct access to the file
2428 afpDenyConflict -5006 Requested access permission not possible
2432 See also: HOpenAware, HOpenRFAware, FSpOpenRFAware
2435 /*****************************************************************************/
2437 pascal OSErr
HOpenRFAware(short vRefNum
,
2439 ConstStr255Param fileName
,
2442 /* ¦ Open the resource fork of a file using deny mode permissions.
2443 The HOpenRFAware function opens the resource fork of a file using deny
2444 mode permissions instead the normal File Manager permissions. If
2445 OpenRFDeny is not available, then HOpenRFAware translates the deny
2446 modes to the closest File Manager permissions and tries to open the
2447 file with OpenRF. By using HOpenRFAware with deny mode permissions,
2448 a program can be "AppleShare aware" and fall back on the standard
2449 File Manager open calls automatically.
2451 vRefNum input: Volume specification.
2452 dirID input: Directory ID.
2453 fileName input: The name of the file.
2454 denyModes input: The deny modes access under which to open the file.
2455 refNum output: The file reference number of the opened file.
2459 nsvErr -35 No such volume
2460 tmfoErr -42 Too many files open
2461 fnfErr -43 File not found
2462 wPrErr -44 Volume locked by hardware
2463 fLckdErr -45 File is locked
2464 vLckdErr -46 Volume is locked or read-only
2465 opWrErr -49 File already open for writing
2466 paramErr -50 No default volume
2467 permErr -54 File is already open and cannot be opened using specified deny modes
2468 afpAccessDenied -5000 User does not have the correct access to the file
2469 afpDenyConflict -5006 Requested access permission not possible
2473 See also: HOpenAware, FSpOpenAware, FSpOpenRFAware
2476 /*****************************************************************************/
2478 pascal OSErr
FSpOpenRFAware(const FSSpec
*spec
,
2481 /* ¦ Open the resource fork of a file using deny mode permissions.
2482 The FSpOpenRFAware function opens the resource fork of a file using deny
2483 mode permissions instead the normal File Manager permissions. If
2484 OpenRFDeny is not available, then FSpOpenRFAware translates the deny
2485 modes to the closest File Manager permissions and tries to open the
2486 file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
2487 a program can be "AppleShare aware" and fall back on the standard
2488 File Manager open calls automatically.
2490 spec input: An FSSpec record specifying the file.
2491 denyModes input: The deny modes access under which to open the file.
2492 refNum output: The file reference number of the opened file.
2496 nsvErr -35 No such volume
2497 tmfoErr -42 Too many files open
2498 fnfErr -43 File not found
2499 wPrErr -44 Volume locked by hardware
2500 fLckdErr -45 File is locked
2501 vLckdErr -46 Volume is locked or read-only
2502 opWrErr -49 File already open for writing
2503 paramErr -50 No default volume
2504 permErr -54 File is already open and cannot be opened using specified deny modes
2505 afpAccessDenied -5000 User does not have the correct access to the file
2506 afpDenyConflict -5006 Requested access permission not possible
2510 See also: HOpenAware, FSpOpenAware, HOpenRFAware
2513 /*****************************************************************************/
2515 pascal OSErr
FSReadNoCache(short refNum
,
2518 /* ¦ Read any number of bytes from an open file requesting no caching.
2519 The FSReadNoCache function reads any number of bytes from an open file
2520 while asking the file system to bypass its cache mechanism.
2522 refNum input: The file reference number of an open file.
2523 count input: The number of bytes to read.
2524 output: The number of bytes actually read.
2525 buffPtr input: A pointer to the data buffer into which the bytes are
2530 readErr Ð19 Driver does not respond to read requests
2531 badUnitErr Ð21 Driver reference number does not
2533 unitEmptyErr Ð22 Driver reference number specifies a
2534 nil handle in unit table
2535 abortErr Ð27 Request aborted by KillIO
2536 notOpenErr Ð28 Driver not open
2537 ioErr Ð36 Data does not match in read-verify mode
2538 fnOpnErr -38 File not open
2539 rfNumErr -51 Bad reference number
2540 afpAccessDenied -5000 User does not have the correct access to
2545 See also: FSWriteNoCache
2548 /*****************************************************************************/
2550 pascal OSErr
FSWriteNoCache(short refNum
,
2552 const void *buffPtr
);
2553 /* ¦ Write any number of bytes to an open file requesting no caching.
2554 The FSReadNoCache function writes any number of bytes to an open file
2555 while asking the file system to bypass its cache mechanism.
2557 refNum input: The file reference number of an open file.
2558 count input: The number of bytes to write to the file.
2559 output: The number of bytes actually written.
2560 buffPtr input: A pointer to the data buffer from which the bytes are
2565 writErr Ð20 Driver does not respond to write requests
2566 badUnitErr Ð21 Driver reference number does not
2568 unitEmptyErr Ð22 Driver reference number specifies a
2569 nil handle in unit table
2570 abortErr Ð27 Request aborted by KillIO
2571 notOpenErr Ð28 Driver not open
2572 dskFulErr -34 Disk full
2573 ioErr Ð36 Data does not match in read-verify mode
2574 fnOpnErr -38 File not open
2575 wPrErr -44 Hardware volume lock
2576 fLckdErr -45 File is locked
2577 vLckdErr -46 Software volume lock
2578 rfNumErr -51 Bad reference number
2579 wrPermErr -61 Read/write permission doesnÕt
2581 afpAccessDenied -5000 User does not have the correct access to
2586 See also: FSReadNoCache
2589 /*****************************************************************************/
2591 pascal OSErr
FSWriteVerify(short refNum
,
2593 const void *buffPtr
);
2594 /* ¦ Write any number of bytes to an open file and then verify the data was written.
2595 The FSWriteVerify function writes any number of bytes to an open file
2596 and then verifies that the data was actually written to the device.
2598 refNum input: The file reference number of an open file.
2599 count input: The number of bytes to write to the file.
2600 output: The number of bytes actually written and verified.
2601 buffPtr input: A pointer to the data buffer from which the bytes are
2606 readErr Ð19 Driver does not respond to read requests
2607 writErr Ð20 Driver does not respond to write requests
2608 badUnitErr Ð21 Driver reference number does not
2610 unitEmptyErr Ð22 Driver reference number specifies a
2611 nil handle in unit table
2612 abortErr Ð27 Request aborted by KillIO
2613 notOpenErr Ð28 Driver not open
2614 dskFulErr -34 Disk full
2615 ioErr Ð36 Data does not match in read-verify mode
2616 fnOpnErr -38 File not open
2617 eofErr -39 Logical end-of-file reached
2618 posErr -40 Attempt to position mark before start
2620 wPrErr -44 Hardware volume lock
2621 fLckdErr -45 File is locked
2622 vLckdErr -46 Software volume lock
2623 rfNumErr -51 Bad reference number
2624 gfpErr -52 Error during GetFPos
2625 wrPermErr -61 Read/write permission doesnÕt
2627 memFullErr -108 Not enough room in heap zone to allocate
2629 afpAccessDenied -5000 User does not have the correct access to
2633 /*****************************************************************************/
2635 pascal OSErr
CopyFork(short srcRefNum
,
2637 void *copyBufferPtr
,
2638 long copyBufferSize
);
2639 /* ¦ Copy all data from the source fork to the destination fork of open file forks.
2640 The CopyFork function copies all data from the source fork to the
2641 destination fork of open file forks and makes sure the destination EOF
2642 is equal to the source EOF.
2644 srcRefNum input: The source file reference number.
2645 dstRefNum input: The destination file reference number.
2646 copyBufferPtr input: Pointer to buffer to use during copy. The
2647 buffer should be at least 512-bytes minimum.
2648 The larger the buffer, the faster the copy.
2649 copyBufferSize input: The size of the copy buffer.
2653 readErr Ð19 Driver does not respond to read requests
2654 writErr Ð20 Driver does not respond to write requests
2655 badUnitErr Ð21 Driver reference number does not
2657 unitEmptyErr Ð22 Driver reference number specifies a
2658 nil handle in unit table
2659 abortErr Ð27 Request aborted by KillIO
2660 notOpenErr Ð28 Driver not open
2661 dskFulErr -34 Disk full
2662 ioErr Ð36 Data does not match in read-verify mode
2663 fnOpnErr -38 File not open
2664 wPrErr -44 Hardware volume lock
2665 fLckdErr -45 File is locked
2666 vLckdErr -46 Software volume lock
2667 rfNumErr -51 Bad reference number
2668 wrPermErr -61 Read/write permission doesnÕt
2670 afpAccessDenied -5000 User does not have the correct access to
2674 /*****************************************************************************/
2676 pascal OSErr
GetFileLocation(short refNum
,
2679 StringPtr fileName
);
2680 /* ¦ Get the location of an open file.
2681 The GetFileLocation function gets the location (volume reference number,
2682 directory ID, and fileName) of an open file.
2684 refNum input: The file reference number of an open file.
2685 vRefNum output: The volume reference number.
2686 dirID output: The parent directory ID.
2687 fileName input: Points to a buffer (minimum Str63) where the
2688 filename is to be returned or must be nil.
2689 output: The filename.
2693 nsvErr -35 Specified volume doesnÕt exist
2694 fnOpnErr -38 File not open
2695 rfNumErr -51 Reference number specifies nonexistent
2700 See also: FSpGetFileLocation
2703 /*****************************************************************************/
2705 pascal OSErr
FSpGetFileLocation(short refNum
,
2707 /* ¦ Get the location of an open file in an FSSpec record.
2708 The FSpGetFileLocation function gets the location of an open file in
2711 refNum input: The file reference number of an open file.
2712 spec output: FSSpec record containing the file name and location.
2716 nsvErr -35 Specified volume doesnÕt exist
2717 fnOpnErr -38 File not open
2718 rfNumErr -51 Reference number specifies nonexistent
2723 See also: GetFileLocation
2726 /*****************************************************************************/
2728 pascal OSErr
CopyDirectoryAccess(short srcVRefNum
,
2730 ConstStr255Param srcName
,
2733 ConstStr255Param dstName
);
2734 /* ¦ Copy the AFP directory access privileges.
2735 The CopyDirectoryAccess function copies the AFP directory access
2736 privileges from one directory to another. Both directories must be on
2737 the same file server, but not necessarily on the same server volume.
2739 srcVRefNum input: Source volume specification.
2740 srcDirID input: Source directory ID.
2741 srcName input: Pointer to source directory name, or nil when
2742 srcDirID specifies the directory.
2743 dstVRefNum input: Destination volume specification.
2744 dstDirID input: Destination directory ID.
2745 dstName input: Pointer to destination directory name, or nil when
2746 dstDirID specifies the directory.
2750 nsvErr -35 Volume not found
2751 fnfErr -43 Directory not found
2752 vLckdErr -46 Volume is locked or read-only
2753 paramErr -50 Volume doesn't support this function
2754 afpAccessDenied -5000 User does not have the correct access
2756 afpObjectTypeErr -5025 Object is a file, not a directory
2760 See also: FSpCopyDirectoryAccess
2763 /*****************************************************************************/
2765 pascal OSErr
FSpCopyDirectoryAccess(const FSSpec
*srcSpec
,
2766 const FSSpec
*dstSpec
);
2767 /* ¦ Copy the AFP directory access privileges.
2768 The FSpCopyDirectoryAccess function copies the AFP directory access
2769 privileges from one directory to another. Both directories must be on
2770 the same file server, but not necessarily on the same server volume.
2772 srcSpec input: An FSSpec record specifying the source directory.
2773 dstSpec input: An FSSpec record specifying the destination directory.
2777 nsvErr -35 Volume not found
2778 fnfErr -43 Directory not found
2779 vLckdErr -46 Volume is locked or read-only
2780 paramErr -50 Volume doesn't support this function
2781 afpAccessDenied -5000 User does not have the correct access
2783 afpObjectTypeErr -5025 Object is a file, not a directory
2787 See also: CopyDirectoryAccess
2790 /*****************************************************************************/
2792 pascal OSErr
HMoveRenameCompat(short vRefNum
,
2794 ConstStr255Param srcName
,
2796 ConstStr255Param dstpathName
,
2797 ConstStr255Param copyName
);
2798 /* ¦ Move a file or directory and optionally rename it.
2799 The HMoveRenameCompat function moves a file or directory and optionally
2800 renames it. The source and destination locations must be on the same
2801 volume. This routine works even if the volume doesn't support MoveRename.
2803 vRefNum input: Volume specification.
2804 srcDirID input: Source directory ID.
2805 srcName input: The source object name.
2806 dstDirID input: Destination directory ID.
2807 dstName input: Pointer to destination directory name, or
2808 nil when dstDirID specifies a directory.
2809 copyName input: Points to the new name if the object is to be
2810 renamed or nil if the object isn't to be renamed.
2814 dirFulErr -33 File directory full
2815 dskFulErr -34 Disk is full
2816 nsvErr -35 Volume not found
2818 bdNamErr -37 Bad filename or attempt to move into
2820 fnfErr -43 Source file or directory not found
2821 wPrErr -44 Hardware volume lock
2822 fLckdErr -45 File is locked
2823 vLckdErr -46 Destination volume is read-only
2824 fBsyErr -47 File busy, directory not empty, or
2825 working directory control block open
2826 dupFNErr -48 Destination already exists
2827 paramErr -50 Volume doesn't support this function,
2828 no default volume, or source and
2829 volOfflinErr -53 Volume is offline
2830 fsRnErr -59 Problem during rename
2831 dirNFErr -120 Directory not found or incomplete pathname
2832 badMovErr -122 Attempted to move directory into
2834 wrgVolTypErr -123 Not an HFS volume (it's a MFS volume)
2835 notAFileErr -1302 The pathname is nil, the pathname
2836 is empty, or the pathname cannot refer
2838 diffVolErr -1303 Files on different volumes
2839 afpAccessDenied -5000 The user does not have the right to
2840 move the file or directory
2841 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2842 afpSameObjectErr -5038 Source and destination files are the same
2846 See also: FSpMoveRenameCompat
2849 /*****************************************************************************/
2851 pascal OSErr
FSpMoveRenameCompat(const FSSpec
*srcSpec
,
2852 const FSSpec
*dstSpec
,
2853 ConstStr255Param copyName
);
2854 /* ¦ Move a file or directory and optionally rename it.
2855 The FSpMoveRenameCompat function moves a file or directory and optionally
2856 renames it. The source and destination locations must be on the same
2857 volume. This routine works even if the volume doesn't support MoveRename.
2859 srcSpec input: An FSSpec record specifying the source object.
2860 dstSpec input: An FSSpec record specifying the destination
2862 copyName input: Points to the new name if the object is to be
2863 renamed or nil if the object isn't to be renamed.
2867 dirFulErr -33 File directory full
2868 dskFulErr -34 Disk is full
2869 nsvErr -35 Volume not found
2871 bdNamErr -37 Bad filename or attempt to move into
2873 fnfErr -43 Source file or directory not found
2874 wPrErr -44 Hardware volume lock
2875 fLckdErr -45 File is locked
2876 vLckdErr -46 Destination volume is read-only
2877 fBsyErr -47 File busy, directory not empty, or
2878 working directory control block open
2879 dupFNErr -48 Destination already exists
2880 paramErr -50 Volume doesn't support this function,
2881 no default volume, or source and
2882 volOfflinErr -53 Volume is offline
2883 fsRnErr -59 Problem during rename
2884 dirNFErr -120 Directory not found or incomplete pathname
2885 badMovErr -122 Attempted to move directory into
2887 wrgVolTypErr -123 Not an HFS volume (it's a MFS volume)
2888 notAFileErr -1302 The pathname is nil, the pathname
2889 is empty, or the pathname cannot refer
2891 diffVolErr -1303 Files on different volumes
2892 afpAccessDenied -5000 The user does not have the right to
2893 move the file or directory
2894 afpObjectTypeErr -5025 Directory not found or incomplete pathname
2895 afpSameObjectErr -5038 Source and destination files are the same
2899 See also: HMoveRenameCompat
2902 /*****************************************************************************/
2904 pascal OSErr
BuildAFPVolMountInfo(short flags
,
2914 AFPVolMountInfoPtr
*afpInfoPtr
);
2915 /* ¦ Allocate and initializes the fields of an AFPVolMountInfo record.
2916 The BuildAFPVolMountInfo function allocates and initializes the fields
2917 of an AFPVolMountInfo record before using that record to call
2918 the VolumeMount function.
2920 flags input: The AFP mounting flags. 0 = normal mount;
2921 set bit 0 to inhibit greeting messages.
2922 nbpInterval input: The interval used for VolumeMount's
2923 NBP Lookup call. 7 is a good choice.
2924 nbpCount input: The retry count used for VolumeMount's
2925 NBP Lookup call. 5 is a good choice.
2926 uamType input: The user authentication method to use.
2927 zoneName input: The AppleTalk zone name of the server.
2928 serverName input: The AFP server name.
2929 volName input: The AFP volume name.
2930 userName input: The user name (zero length Pascal string for
2932 userPassWord input: The user password (zero length Pascal string
2933 if no user password)
2934 volPassWord input: The volume password (zero length Pascal string
2935 if no volume password)
2936 afpInfoPtr output: A pointer to the newly created and initialized
2937 AFPVolMountInfo record. If the function fails to
2938 create an AFPVolMountInfo record, it sets
2939 afpInfoPtr to NULL and the function result is
2940 memFullErr. Your program is responsible
2941 for disposing of this pointer when it is finished
2946 memFullErr -108 memory full error
2950 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
2951 RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo,
2952 RetrieveAFPXVolMountInfo
2955 /*****************************************************************************/
2957 pascal OSErr
RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr
,
2961 StringPtr serverName
,
2963 StringPtr userName
);
2964 /* ¦ Retrieve the AFP mounting information from an AFPVolMountInfo record.
2965 The RetrieveAFPVolMountInfo function retrieves the AFP mounting
2966 information returned in an AFPVolMountInfo record by the
2967 GetVolMountInfo function.
2969 afpInfoPtr input: Pointer to AFPVolMountInfo record that contains
2970 the AFP mounting information.
2971 flags output: The AFP mounting flags.
2972 uamType output: The user authentication method used.
2973 zoneName output: The AppleTalk zone name of the server.
2974 serverName output: The AFP server name.
2975 volName output: The AFP volume name.
2976 userName output: The user name (zero length Pascal string for
2981 paramErr -50 media field in AFP mounting information
2982 was not AppleShareMediaType
2986 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
2987 BuildAFPVolMountInfo, BuildAFPXVolMountInfo,
2988 RetrieveAFPXVolMountInfo
2991 /*****************************************************************************/
2993 pascal OSErr
BuildAFPXVolMountInfo(short flags
,
3004 unsigned long alternateAddressLength
,
3005 void *alternateAddress
,
3006 AFPXVolMountInfoPtr
*afpXInfoPtr
);
3007 /* ¦ Allocate and initializes the fields of an AFPXVolMountInfo record.
3008 The BuildAFPXVolMountInfo function allocates and initializes the fields
3009 of an AFPXVolMountInfo record before using that record to call
3010 the VolumeMount function.
3012 flags input: The AFP mounting flags.
3013 nbpInterval input: The interval used for VolumeMount's
3014 NBP Lookup call. 7 is a good choice.
3015 nbpCount input: The retry count used for VolumeMount's
3016 NBP Lookup call. 5 is a good choice.
3017 uamType input: The user authentication method to use.
3018 zoneName input: The AppleTalk zone name of the server.
3019 serverName input: The AFP server name.
3020 volName input: The AFP volume name.
3021 userName input: The user name (zero length Pascal string
3023 userPassWord input: The user password (zero length Pascal
3024 string if no user password)
3025 volPassWord input: The volume password (zero length Pascal
3026 string if no volume password)
3027 uamName input: The User Authentication Method name.
3028 alternateAddressLength input: Length of alternateAddress data.
3029 alternateAddress input The AFPAlternateAddress (variable length)
3030 afpXInfoPtr output: A pointer to the newly created and
3031 initialized AFPVolMountInfo record.
3032 If the function fails to create an
3033 AFPVolMountInfo record, it sets
3034 afpInfoPtr to NULL and the function
3035 result is memFullErr. Your program is
3036 responsible for disposing of this pointer
3037 when it is finished with it.
3041 memFullErr -108 memory full error
3045 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
3046 BuildAFPVolMountInfo, RetrieveAFPVolMountInfo,
3047 RetrieveAFPXVolMountInfo
3050 /*****************************************************************************/
3052 pascal OSErr
RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr
,
3056 StringPtr serverName
,
3060 unsigned long *alternateAddressLength
,
3061 AFPAlternateAddress
**alternateAddress
);
3062 /* ¦ Retrieve the AFP mounting information from an AFPXVolMountInfo record.
3063 The RetrieveAFPXVolMountInfo function retrieves the AFP mounting
3064 information returned in an AFPXVolMountInfo record by the
3065 GetVolMountInfo function.
3067 afpXInfoPtr input: Pointer to AFPXVolMountInfo record that
3068 contains the AFP mounting information.
3069 flags output: The AFP mounting flags.
3070 uamType output: The user authentication method used.
3071 zoneName output: The AppleTalk zone name of the server.
3072 serverName output: The AFP server name.
3073 volName output: The AFP volume name.
3074 userName output: The user name (zero length Pascal
3076 uamName output: The User Authentication Method name.
3077 alternateAddressLength output: Length of alternateAddress data returned.
3078 alternateAddress: output: A pointer to the newly created and
3079 AFPAlternateAddress record (a variable
3080 length record). If the function fails to
3081 create an AFPAlternateAddress record,
3082 it sets alternateAddress to NULL and the
3083 function result is memFullErr. Your
3084 program is responsible for disposing of
3085 this pointer when it is finished with it.
3089 paramErr -50 media field in AFP mounting information
3090 was not AppleShareMediaType
3091 memFullErr -108 memory full error
3095 Also see: GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
3096 BuildAFPVolMountInfo, RetrieveAFXVolMountInfo,
3097 BuildAFPXVolMountInfo
3100 /*****************************************************************************/
3102 pascal OSErr
GetUGEntries(short objType
,
3105 long *actEntryCount
,
3107 /* ¦ Retrieve a list of user or group entries from the local file server.
3108 The GetUGEntries functions retrieves a list of user or group entries
3109 from the local file server.
3111 objType input: The object type: -1 = group; 0 = user
3112 UGEntries input: Pointer to array of UGEntry records where the list
3114 reqEntryCount input: The number of elements in the UGEntries array.
3115 actEntryCount output: The number of entries returned.
3116 objID input: The current index position. Set to 0 to start with
3118 output: The index position to get the next entry. Pass this
3119 value the next time you call GetUGEntries to start
3124 fnfErr -43 No more users or groups
3125 paramErr -50 Function not supported; or, ioObjID is
3130 Also see: GetUGEntry
3133 /*****************************************************************************/
3139 #include "OptimEnd.h"
3141 #endif /* __MOREFILESEXTRAS__ */