4 Contains: The long lost high-level and FSSpec File Manager functions.
6 Version: Technology: MoreFiles
9 Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved.
11 Bugs?: For bug reports, consult the following page on
14 http://developer.apple.com/bugreporter/
19 You may incorporate this sample code into your applications without
20 restriction, though the sample code has been provided "AS IS" and the
21 responsibility for its operation is 100% yours. However, what you are
22 not permitted to do is to redistribute the source as "DSC Sample Code"
23 after having made changes. If you're going to re-distribute the source,
24 we require that you make it clear in the source that the code was
25 descended from Apple Sample Code, but that you've made changes.
39 #include "Optimization.h"
54 #if PRAGMA_STRUCT_ALIGN
55 #pragma options align=mac68k
56 #elif PRAGMA_STRUCT_PACKPUSH
58 #elif PRAGMA_STRUCT_PACK
62 /*****************************************************************************/
66 ConstStr255Param volName
,
68 GetVolParmsInfoBuffer
* volParmsInfo
,
73 The HGetVolParms function returns information about the characteristics
74 of a volume. A result of paramErr usually just means the volume doesn't
75 support PBHGetVolParms and the feature you were going to check
78 volName input: A pointer to the name of a mounted volume
80 vRefNum input: Volume specification.
81 volParmsInfo input: Pointer to GetVolParmsInfoBuffer where the
82 volume attributes information is returned.
83 output: Atributes information.
84 infoSize input: Size of buffer pointed to by volParmsInfo.
85 output: Size of data actually returned.
89 nsvErr -35 Volume not found
90 paramErr -50 Volume doesn't support this function
94 Also see the macros for checking attribute bits in MoreFilesExtras.h
97 /*****************************************************************************/
103 ConstStr255Param fileName
);
107 The HCreateMinimum function creates a new file without attempting to set
108 the creator and file type of the new file. This function is needed to
109 create a file in an AppleShare "drop box" where the user can make
110 changes, but cannot see folder or files.
112 vRefNum input: Volume specification.
113 dirID input: Directory ID.
114 fileName input: The name of the new file.
118 dirFulErr -33 File directory full
119 dskFulErr -34 Disk is full
120 nsvErr -35 No such volume
122 bdNamErr -37 Bad filename
123 fnfErr -43 Directory not found or incomplete pathname
124 wPrErr -44 Hardware volume lock
125 vLckdErr -46 Software volume lock
126 dupFNErr -48 Duplicate filename and version
127 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
128 afpAccessDenied -5000 User does not have the correct access
129 afpObjectTypeErr -5025 A directory exists with that name
133 Also see: FSpCreateMinimum
136 /*****************************************************************************/
139 FSpCreateMinimum(const FSSpec
* spec
);
143 The FSpCreateMinimum function creates a new file without attempting to set
144 the the creator and file type of the new file. This function is needed to
145 create a file in an AppleShare "dropbox" where the user can make
146 changes, but cannot see folder or files.
148 spec input: An FSSpec record specifying the file to create.
152 dirFulErr -33 File directory full
153 dskFulErr -34 Disk is full
154 nsvErr -35 No such volume
156 bdNamErr -37 Bad filename
157 fnfErr -43 Directory not found or incomplete pathname
158 wPrErr -44 Hardware volume lock
159 vLckdErr -46 Software volume lock
160 dupFNErr -48 Duplicate filename and version
161 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
162 afpAccessDenied -5000 User does not have the correct access
163 afpObjectTypeErr -5025 A directory exists with that name
167 Also see: HCreateMinimum
170 /*****************************************************************************/
176 ConstStr255Param srcName
,
178 ConstStr255Param dstName
);
182 The ExchangeFiles function swaps the data in two files on the same
183 volume by changing some of the information in the volume catalog and,
184 if the files are open, in the file control blocks.
186 vRefNum input: Volume specification.
187 srcDirID input: Source directory ID.
188 srcName input: Source file name.
189 dstDirID input: Destination directory ID.
190 dstName input: Destination file name.
194 nsvErr -35 Volume not found
196 fnfErr -43 File not found
197 fLckdErr -45 File is locked
198 vLckdErr -46 Volume is locked or read-only
199 paramErr -50 Function not supported by volume
200 volOfflinErr -53 Volume is offline
201 wrgVolTypErr -123 Not an HFS volume
202 diffVolErr -1303 Files on different volumes
203 afpAccessDenied -5000 User does not have the correct access
204 afpObjectTypeErr -5025 Object is a directory, not a file
205 afpSameObjectErr -5038 Source and destination are the same
209 Also see: FSpExchangeFilesCompat
212 /*****************************************************************************/
216 ConstStr255Param volName
,
224 The ResolveFileIDRef function returns the filename and parent directory ID
225 of the file with the specified file ID reference.
227 volName input: A pointer to the name of a mounted volume
229 vRefNum input: Volume specification.
230 fileID input: The file ID reference.
231 parID output: The parent directory ID of the file.
232 name input: Points to a buffer (minimum Str63) where the filename
233 is to be returned or must be nil.
234 output: The filename.
238 nsvErr -35 Volume not found
240 fnfErr -43 File not found
241 paramErr -50 Function not supported by volume
242 volOfflinErr -53 Volume is offline
243 extFSErr -58 External file system error - no file
244 system claimed this call.
245 wrgVolTypErr -123 Not an HFS volume
246 fidNotFoundErr -1300 File ID reference not found
247 notAFileErr -1302 Specified file is a directory
248 afpAccessDenied -5000 User does not have the correct access
249 afpObjectTypeErr -5025 Specified file is a directory
250 afpIDNotFound -5034 File ID reference not found
251 afpBadIDErr -5039 File ID reference not found
255 Also see: FSpResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
259 /*****************************************************************************/
263 ConstStr255Param volName
,
270 The FSpResolveFileIDRef function fills in an FSSpec with the location
271 of the file with the specified file ID reference.
273 volName input: A pointer to the name of a mounted volume
275 vRefNum input: Volume specification.
276 fileID input: The file ID reference.
277 spec input: A pointer to a FSSpec record.
278 output: A file system specification to be filled in by
283 nsvErr -35 Volume not found
285 fnfErr -43 File not found
286 paramErr -50 Function not supported by volume or
288 volOfflinErr -53 Volume is offline
289 extFSErr -58 External file system error - no file
290 system claimed this call.
291 wrgVolTypErr -123 Not an HFS volume
292 fidNotFoundErr -1300 File ID reference not found
293 notAFileErr -1302 Specified file is a directory
294 afpAccessDenied -5000 User does not have the correct access
295 afpObjectTypeErr -5025 Specified file is a directory
296 afpIDNotFound -5034 File ID reference not found
297 afpBadIDErr -5039 File ID reference not found
301 Also see: ResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
305 /*****************************************************************************/
311 ConstStr255Param fileName
,
316 The CreateFileIDRef function creates a file ID reference for the
317 specified file, or if a file ID reference already exists, supplies
318 the file ID reference and returns the result code fidExists or afpIDExists.
320 vRefNum input: Volume specification.
321 parID input: Directory ID.
322 fileName input: The name of the file.
323 fileID output: The file ID reference (if result is noErr,
324 fidExists, or afpIDExists).
328 nsvErr -35 Volume not found
330 fnfErr -43 File not found
331 wPrErr -44 Hardware volume lock
332 vLckdErr -46 Software volume lock
333 paramErr -50 Function not supported by volume
334 volOfflinErr -53 Volume is offline
335 extFSErr -58 External file system error - no file
336 system claimed this call.
337 wrgVolTypErr -123 Not an HFS volume
338 fidExists -1301 File ID reference already exists
339 notAFileErrn -1302 Specified file is a directory
340 afpAccessDenied -5000 User does not have the correct access
341 afpObjectTypeErr -5025 Specified file is a directory
342 afpIDExists -5035 File ID reference already exists
346 Also see: FSpResolveFileIDRef, ResolveFileIDRef, FSpCreateFileIDRef,
350 /*****************************************************************************/
359 The FSpCreateFileIDRef function creates a file ID reference for the
360 specified file, or if a file ID reference already exists, supplies
361 the file ID reference and returns the result code fidExists or afpIDExists.
363 spec input: An FSSpec record specifying the file.
364 fileID output: The file ID reference (if result is noErr,
365 fidExists, or afpIDExists).
369 nsvErr -35 Volume not found
371 fnfErr -43 File not found
372 wPrErr -44 Hardware volume lock
373 vLckdErr -46 Software volume lock
374 paramErr -50 Function not supported by volume
375 volOfflinErr -53 Volume is offline
376 extFSErr -58 External file system error - no file
377 system claimed this call.
378 wrgVolTypErr -123 Not an HFS volume
379 fidExists -1301 File ID reference already exists
380 notAFileErrn -1302 Specified file is a directory
381 afpAccessDenied -5000 User does not have the correct access
382 afpObjectTypeErr -5025 Specified file is a directory
383 afpIDExists -5035 File ID reference already exists
387 Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
391 /*****************************************************************************/
395 ConstStr255Param volName
,
401 The DeleteFileIDRef function deletes a file ID reference.
403 volName input: A pointer to the name of a mounted volume
405 vRefNum input: Volume specification.
406 fileID input: The file ID reference.
410 nsvErr -35 Volume not found
412 fnfErr -43 File not found
413 wPrErr -44 Hardware volume lock
414 vLckdErr -46 Software volume lock
415 paramErr -50 Function not supported by volume
416 volOfflinErr -53 Volume is offline
417 extFSErr -58 External file system error - no file
418 system claimed this call.
419 wrgVolTypErr -123 Function is not supported by volume
420 fidNotFoundErr -1300 File ID reference not found
421 afpAccessDenied -5000 User does not have the correct access
422 afpObjectTypeErr -5025 Specified file is a directory
423 afpIDNotFound -5034 File ID reference not found
427 Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
431 /*****************************************************************************/
434 FlushFile(short refNum
);
438 The FlushFile function writes the contents of a file's access path
439 buffer (the fork data) to the volume. Note: some of the file's catalog
440 information stored on the volume may not be correct until FlushVol
443 refNum input: The file reference number of an open file.
447 nsvErr -35 Volume not found
449 fnOpnErr -38 File not open
450 fnfErr -43 File not found
451 rfNumErr -51 Bad reference number
452 extFSErr -58 External file system error - no file
453 system claimed this call.
456 /*****************************************************************************/
466 The LockRange function locks (denies access to) a portion of a file
467 that was opened with shared read/write permission.
469 refNum input: The file reference number of an open file.
470 rangeLength input: The number of bytes in the range.
471 rangeStart input: The starting byte in the range to lock.
476 fnOpnErr -38 File not open
477 eofErr -39 Logical end-of-file reached
478 fLckdErr -45 File is locked by another user
479 paramErr -50 Negative ioReqCount
480 rfNumErr -51 Bad reference number
481 extFSErr -58 External file system error - no file
482 system claimed this call.
483 volGoneErr -124 Server volume has been disconnected
484 afpNoMoreLocks -5015 No more ranges can be locked
485 afpRangeOverlap -5021 Part of range is already locked
489 Also see: UnlockRange
492 /*****************************************************************************/
502 The UnlockRange function unlocks (allows access to) a previously locked
503 portion of a file that was opened with shared read/write permission.
505 refNum input: The file reference number of an open file.
506 rangeLength input: The number of bytes in the range.
507 rangeStart input: The starting byte in the range to unlock.
512 fnOpnErr -38 File not open
513 eofErr -39 Logical end-of-file reached
514 paramErr -50 Negative ioReqCount
515 rfNumErr -51 Bad reference number
516 extFSErr -58 External file system error - no file
517 system claimed this call.
518 volGoneErr -124 Server volume has been disconnected
519 afpRangeNotLocked -5020 Specified range was not locked
526 /*****************************************************************************/
532 ConstStr255Param name
,
533 void * foreignPrivBuffer
,
534 long * foreignPrivSize
,
535 long * foreignPrivInfo1
,
536 long * foreignPrivInfo2
,
537 long * foreignPrivInfo3
,
538 long * foreignPrivInfo4
);
542 The GetForeignPrivs function retrieves the native access-control
543 information for a file or directory stored on a volume managed by
544 a foreign file system.
546 vRefNum input: Volume specification.
547 dirID input: Directory ID.
548 name input: Pointer to object name, or nil when dirID
549 specifies a directory that's the object.
550 foreignPrivBuffer input: Pointer to buffer where the privilege
551 information is returned.
552 output: Privilege information.
553 foreignPrivSize input: Size of buffer pointed to by
555 output: Amount of buffer actually used.
556 foreignPrivInfo1 output: Information specific to privilege model.
557 foreignPrivInfo2 output: Information specific to privilege model.
558 foreignPrivInfo3 output: Information specific to privilege model.
559 foreignPrivInfo4 output: Information specific to privilege model.
563 nsvErr -35 Volume not found
564 paramErr -50 Volume is HFS or MFS (that is, it has
565 no foreign privilege model), or foreign
566 volume does not support these calls
570 Also see: FSpGetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
573 /*****************************************************************************/
578 void * foreignPrivBuffer
,
579 long * foreignPrivSize
,
580 long * foreignPrivInfo1
,
581 long * foreignPrivInfo2
,
582 long * foreignPrivInfo3
,
583 long * foreignPrivInfo4
);
587 The FSpGetForeignPrivs function retrieves the native access-control
588 information for a file or directory stored on a volume managed by
589 a foreign file system.
591 spec input: An FSSpec record specifying the object.
592 foreignPrivBuffer input: Pointer to buffer where the privilege
593 information is returned.
594 output: Privilege information.
595 foreignPrivSize input: Size of buffer pointed to by
597 output: Amount of buffer actually used.
598 foreignPrivInfo1 output: Information specific to privilege model.
599 foreignPrivInfo2 output: Information specific to privilege model.
600 foreignPrivInfo3 output: Information specific to privilege model.
601 foreignPrivInfo4 output: Information specific to privilege model.
605 nsvErr -35 Volume not found
606 paramErr -50 Volume is HFS or MFS (that is, it has
607 no foreign privilege model), or foreign
608 volume does not support these calls
612 Also see: GetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
615 /*****************************************************************************/
621 ConstStr255Param name
,
622 const void * foreignPrivBuffer
,
623 long * foreignPrivSize
,
624 long foreignPrivInfo1
,
625 long foreignPrivInfo2
,
626 long foreignPrivInfo3
,
627 long foreignPrivInfo4
);
631 The SetForeignPrivs function changes the native access-control
632 information for a file or directory stored on a volume managed by
633 a foreign file system.
635 vRefNum input: Volume specification.
636 dirID input: Directory ID.
637 name input: Pointer to object name, or nil when dirID
638 specifies a directory that's the object.
639 foreignPrivBuffer input: Pointer to privilege information buffer.
640 foreignPrivSize input: Size of buffer pointed to by
642 output: Amount of buffer actually used.
643 foreignPrivInfo1 input: Information specific to privilege model.
644 foreignPrivInfo2 input: Information specific to privilege model.
645 foreignPrivInfo3 input: Information specific to privilege model.
646 foreignPrivInfo4 input: Information specific to privilege model.
650 nsvErr -35 Volume not found
651 paramErr -50 Volume is HFS or MFS (that is, it has
652 no foreign privilege model), or foreign
653 volume does not support these calls
657 Also see: GetForeignPrivs, FSpGetForeignPrivs, FSpSetForeignPrivs
660 /*****************************************************************************/
665 const void * foreignPrivBuffer
,
666 long * foreignPrivSize
,
667 long foreignPrivInfo1
,
668 long foreignPrivInfo2
,
669 long foreignPrivInfo3
,
670 long foreignPrivInfo4
);
674 The FSpSetForeignPrivs function changes the native access-control
675 information for a file or directory stored on a volume managed by
676 a foreign file system.
678 spec input: An FSSpec record specifying the object.
679 foreignPrivBuffer input: Pointer to privilege information buffer.
680 foreignPrivSize input: Size of buffer pointed to by
682 output: Amount of buffer actually used.
683 foreignPrivInfo1 input: Information specific to privilege model.
684 foreignPrivInfo2 input: Information specific to privilege model.
685 foreignPrivInfo3 input: Information specific to privilege model.
686 foreignPrivInfo4 input: Information specific to privilege model.
690 nsvErr -35 Volume not found
691 paramErr -50 Volume is HFS or MFS (that is, it has
692 no foreign privilege model), or foreign
693 volume does not support these calls
697 Also see: GetForeignPrivs, FSpGetForeignPrivs, SetForeignPrivs
700 /*****************************************************************************/
704 ConstStr255Param volName
,
711 The HGetLogInInfo function retrieves the login method and user name
712 used to log on to a particular shared volume.
714 volName input: A pointer to the name of a mounted volume
716 vRefNum input: The volume reference number.
717 loginMethod output: The login method used (kNoUserAuthentication,
718 kPassword, kEncryptPassword, or
719 kTwoWayEncryptPassword).
720 userName input: Points to a buffer (minimum Str31) where the user
721 name is to be returned or must be nil.
722 output: The user name.
726 nsvErr -35 Specified volume doesnÕt exist
727 paramErr -50 Function not supported by volume
731 Also see: HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
732 FSpSetDirAccess, HMapName, HMapID
735 /*****************************************************************************/
741 ConstStr255Param name
,
744 long * accessRights
);
748 The HGetDirAccess function retrieves the directory access control
749 information for a directory on a shared volume.
751 vRefNum input: Volume specification.
752 dirID input: Directory ID.
753 name input: Pointer to directory name, or nil if dirID
754 specifies the directory.
755 ownerID output: The directory's owner ID.
756 groupID output: The directory's group ID or
757 0 if no group affiliation.
758 accessRights output: The directory's access rights.
762 fnfErr -43 Directory not found
763 paramErr -50 Function not supported by volume
764 afpAccessDenied -5000 User does not have the correct access
769 Also see: HGetLogInInfo, FSpGetDirAccess, HSetDirAccess,
770 FSpSetDirAccess, HMapName, HMapID
773 /*****************************************************************************/
780 long * accessRights
);
784 The FSpGetDirAccess function retrieves the directory access control
785 information for a directory on a shared volume.
787 spec input: An FSSpec record specifying the directory.
788 ownerID output: The directory's owner ID.
789 groupID output: The directory's group ID or
790 0 if no group affiliation.
791 accessRights output: The directory's access rights.
795 fnfErr -43 Directory not found
796 paramErr -50 Function not supported by volume
797 afpAccessDenied -5000 User does not have the correct access
802 Also see: HGetLogInInfo, HGetDirAccess, HSetDirAccess,
803 FSpSetDirAccess, HMapName, HMapID
806 /*****************************************************************************/
812 ConstStr255Param name
,
819 The HSetDirAccess function changes the directory access control
820 information for a directory on a shared volume. You must own a directory
821 to change its access control information.
823 vRefNum input: Volume specification.
824 dirID input: Directory ID.
825 name input: Pointer to directory name, or nil if dirID
826 specifies the directory.
827 ownerID input: The directory's owner ID.
828 groupID input: The directory's group ID or
829 0 if no group affiliation.
830 accessRights input: The directory's access rights.
834 fnfErr -43 Directory not found
835 vLckdErr -46 Volume is locked or read-only
836 paramErr -50 Parameter error
837 afpAccessDenied -5000 User does not have the correct access
839 afpObjectTypeErr -5025 Object is a file, not a directory
843 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess,
844 FSpSetDirAccess, HMapName, HMapID
847 /*****************************************************************************/
858 The FSpSetDirAccess function changes the directory access control
859 information for a directory on a shared volume. You must own a directory
860 to change its access control information.
862 spec input: An FSSpec record specifying the directory.
863 ownerID input: The directory's owner ID.
864 groupID input: The directory's group ID or
865 0 if no group affiliation.
866 accessRights input: The directory's access rights.
870 fnfErr -43 Directory not found
871 vLckdErr -46 Volume is locked or read-only
872 paramErr -50 Parameter error
873 afpAccessDenied -5000 User does not have the correct access
875 afpObjectTypeErr -5025 Object is a file, not a directory
879 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
883 /*****************************************************************************/
887 ConstStr255Param volName
,
895 The HMapID function determines the name of a user or group if you know
896 the user or group ID.
898 volName input: A pointer to the name of a mounted volume
900 vRefNum input: Volume specification.
901 objType input: The mapping function code: 1 if you're mapping a
902 user ID to a user name or 2 if you're mapping a
903 group ID to a group name.
904 name input: Points to a buffer (minimum Str31) where the user
905 or group name is to be returned or must be nil.
906 output: The user or group name.
910 fnfErr -43 Unrecognizable owner or group name
911 paramErr -50 Function not supported by volume
915 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
916 FSpSetDirAccess, HMapName
919 /*****************************************************************************/
923 ConstStr255Param volName
,
925 ConstStr255Param name
,
931 The HMapName function determines the user or group ID if you know the
934 volName input: A pointer to the name of a mounted volume
936 vRefNum input: Volume specification.
937 name input: The user or group name.
938 objType input: The mapping function code: 3 if you're mapping a
939 user name to a user ID or 4 if you're mapping a
940 group name to a group ID.
941 ugID output: The user or group ID.
945 fnfErr -43 Unrecognizable owner or group name
946 paramErr -50 Function not supported by volume
950 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
951 FSpSetDirAccess, HMapID
954 /*****************************************************************************/
960 ConstStr255Param srcName
,
963 ConstStr255Param dstPathname
,
964 ConstStr255Param copyName
);
968 The HCopyFile function duplicates a file and optionally renames it.
969 The source and destination volumes must be on the same file server.
970 This function instructs the server to copy the file.
972 srcVRefNum input: Source volume specification.
973 srcDirID input: Source directory ID.
974 srcName input: Source file name.
975 dstVRefNum input: Destination volume specification.
976 dstDirID input: Destination directory ID.
977 dstPathname input: Pointer to destination directory name, or
978 nil when dstDirID specifies a directory.
979 copyName input: Points to the new file name if the file is to be
980 renamed or nil if the file isn't to be renamed.
984 dskFulErr -34 Destination volume is full
985 fnfErr -43 Source file not found, or destination
986 directory does not exist
987 vLckdErr -46 Destination volume is read-only
988 fBsyErr -47 The source or destination file could
989 not be opened with the correct access
991 dupFNErr -48 Destination file already exists
992 paramErr -50 Function not supported by volume
993 wrgVolTypErr -123 Function not supported by volume
994 afpAccessDenied -5000 The user does not have the right to
995 read the source or write to the
997 afpDenyConflict -5006 The source or destination file could
998 not be opened with the correct access
1000 afpObjectTypeErr -5025 Source is a directory
1004 Also see: FSpCopyFile, FileCopy, FSpFileCopy
1007 /*****************************************************************************/
1011 const FSSpec
* srcSpec
,
1012 const FSSpec
* dstSpec
,
1013 ConstStr255Param copyName
);
1017 The FSpCopyFile function duplicates a file and optionally renames it.
1018 The source and destination volumes must be on the same file server.
1019 This function instructs the server to copy the file.
1021 srcSpec input: An FSSpec record specifying the source file.
1022 dstSpec input: An FSSpec record specifying the destination
1024 copyName input: Points to the new file name if the file is to be
1025 renamed or nil if the file isn't to be renamed.
1029 dskFulErr -34 Destination volume is full
1030 fnfErr -43 Source file not found, or destination
1031 directory does not exist
1032 vLckdErr -46 Destination volume is read-only
1033 fBsyErr -47 The source or destination file could
1034 not be opened with the correct access
1036 dupFNErr -48 Destination file already exists
1037 paramErr -50 Function not supported by volume
1038 wrgVolTypErr -123 Function not supported by volume
1039 afpAccessDenied -5000 The user does not have the right to
1040 read the source or write to the
1042 afpDenyConflict -5006 The source or destination file could
1043 not be opened with the correct access
1045 afpObjectTypeErr -5025 Source is a directory
1049 Also see: HCopyFile, FileCopy, FSpFileCopy
1052 /*****************************************************************************/
1058 ConstStr255Param srcName
,
1060 ConstStr255Param dstpathName
,
1061 ConstStr255Param copyName
);
1065 The HMoveRename function moves a file or directory and optionally
1066 renames it. The source and destination locations must be on the same
1069 vRefNum input: Volume specification.
1070 srcDirID input: Source directory ID.
1071 srcName input: The source object name.
1072 dstDirID input: Destination directory ID.
1073 dstName input: Pointer to destination directory name, or
1074 nil when dstDirID specifies a directory.
1075 copyName input: Points to the new name if the object is to be
1076 renamed or nil if the object isn't to be renamed.
1080 fnfErr -43 Source file or directory not found
1081 fLckdErr -45 File is locked
1082 vLckdErr -46 Destination volume is read-only
1083 dupFNErr -48 Destination already exists
1084 paramErr -50 Function not supported by volume
1085 badMovErr -122 Attempted to move directory into
1087 afpAccessDenied -5000 The user does not have the right to
1088 move the file or directory
1092 Also see: FSpMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
1095 /*****************************************************************************/
1099 const FSSpec
* srcSpec
,
1100 const FSSpec
* dstSpec
,
1101 ConstStr255Param copyName
);
1105 The FSpMoveRename function moves a file or directory and optionally
1106 renames it. The source and destination locations must be on the same
1109 srcSpec input: An FSSpec record specifying the source object.
1110 dstSpec input: An FSSpec record specifying the destination
1112 copyName input: Points to the new name if the object is to be
1113 renamed or nil if the object isn't to be renamed.
1117 fnfErr -43 Source file or directory not found
1118 fLckdErr -45 File is locked
1119 vLckdErr -46 Destination volume is read-only
1120 dupFNErr -48 Destination already exists
1121 paramErr -50 Function not supported by volume
1122 badMovErr -122 Attempted to move directory into
1124 afpAccessDenied -5000 The user does not have the right to
1125 move the file or directory
1129 Also see: HMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
1132 /*****************************************************************************/
1135 GetVolMountInfoSize(
1136 ConstStr255Param volName
,
1142 The GetVolMountInfoSize function determines the how much space the
1143 program needs to allocate for a volume mounting information record.
1145 volName input: A pointer to the name of a mounted volume
1147 vRefNum input: Volume specification.
1148 size output: The space needed (in bytes) of the volume mounting
1153 nsvErr -35 Volume not found
1154 paramErr -50 Parameter error
1155 extFSErr -58 External file system error - no file
1156 system claimed this call.
1160 Also see: GetVolMountInfo, VolumeMount BuildAFPVolMountInfo,
1161 RetrieveAFPVolMountInfo
1164 /*****************************************************************************/
1168 ConstStr255Param volName
,
1170 void * volMountInfo
);
1174 The GetVolMountInfo function retrieves a volume mounting information
1175 record containing all the information needed to mount the volume,
1176 except for passwords.
1178 volName input: A pointer to the name of a mounted volume
1180 vRefNum input: Volume specification.
1181 volMountInfo output: Points to a volume mounting information
1182 record where the mounting information is to
1187 nsvErr -35 Volume not found
1188 paramErr -50 Parameter error
1189 extFSErr -58 External file system error - no file
1190 system claimed this call.
1194 Also see: GetVolMountInfoSize, VolumeMount, BuildAFPVolMountInfo,
1195 RetrieveAFPVolMountInfo
1198 /*****************************************************************************/
1202 const void * volMountInfo
,
1207 The VolumeMount function mounts a volume using a volume mounting
1210 volMountInfo input: Points to a volume mounting information record.
1211 vRefNum output: A volume reference number.
1215 notOpenErr -28 AppleTalk is not open
1216 nsvErr -35 Volume not found
1217 paramErr -50 Parameter error; typically, zone, server,
1218 and volume name combination is not valid
1219 or not complete, or the user name is not
1221 extFSErr -58 External file system error - no file
1222 system claimed this call.
1223 memFullErr -108 Not enough memory to create a new volume
1224 control block for mounting the volume
1225 afpBadUAM -5002 User authentication method is unknown
1226 afpBadVersNum -5003 Workstation is using an AFP version that
1227 the server doesnÕt recognize
1228 afpNoServer -5016 Server is not responding
1229 afpUserNotAuth -5023 User authentication failed (usually,
1230 password is not correct)
1231 afpPwdExpired -5042 Password has expired on server
1232 afpBadDirIDType -5060 Not a fixed directory ID volume
1233 afpCantMountMoreSrvrs -5061 Maximum number of volumes has been
1235 afpAlreadyMounted -5062 Volume already mounted
1236 afpSameNodeErr -5063 Attempt to log on to a server running
1241 Also see: GetVolMountInfoSize, GetVolMountInfo, BuildAFPVolMountInfo,
1242 RetrieveAFPVolMountInfo
1245 /*****************************************************************************/
1251 ConstStr255Param name
);
1255 The Share function establishes a local volume or directory as a
1258 vRefNum input: Volume specification.
1259 dirID input: Directory ID.
1260 name input: Pointer to directory name, or nil if dirID
1261 specifies the directory.
1265 tmfoErr -42 Too many share points
1266 fnfErr -43 File not found
1267 dupFNErr -48 Already a share point with this name
1268 paramErr -50 Function not supported by volume
1269 dirNFErrdirNFErr -120 Directory not found
1270 afpAccessDenied -5000 This directory cannot be shared
1271 afpObjectTypeErr -5025 Object was a file, not a directory
1272 afpContainsSharedErr -5033 The directory contains a share point
1273 afpInsideSharedErr -5043 The directory is inside a shared directory
1277 Also see: FSpShare, Unshare, FSpUnshare
1280 /*****************************************************************************/
1283 FSpShare(const FSSpec
* spec
);
1287 The FSpShare function establishes a local volume or directory as a
1290 spec input: An FSSpec record specifying the share point.
1294 tmfoErr -42 Too many share points
1295 fnfErr -43 File not found
1296 dupFNErr -48 Already a share point with this name
1297 paramErr -50 Function not supported by volume
1298 dirNFErrdirNFErr -120 Directory not found
1299 afpAccessDenied -5000 This directory cannot be shared
1300 afpObjectTypeErr -5025 Object was a file, not a directory
1301 afpContainsSharedErr -5033 The directory contains a share point
1302 afpInsideSharedErr -5043 The directory is inside a shared directory
1306 Also see: Share, Unshare, FSpUnshare
1309 /*****************************************************************************/
1315 ConstStr255Param name
);
1319 The Unshare function removes a share point.
1321 vRefNum input: Volume specification.
1322 dirID input: Directory ID.
1323 name input: Pointer to directory name, or nil if dirID
1324 specifies the directory.
1328 fnfErr -43 File not found
1329 paramErr -50 Function not supported by volume
1330 dirNFErrdirNFErr -120 Directory not found
1331 afpObjectTypeErr -5025 Object was a file, not a directory; or,
1332 this directory is not a share point
1336 Also see: Share, FSpShare, FSpUnshare
1339 /*****************************************************************************/
1342 FSpUnshare(const FSSpec
* spec
);
1346 The FSpUnshare function removes a share point.
1348 spec input: An FSSpec record specifying the share point.
1352 fnfErr -43 File not found
1353 paramErr -50 Function not supported by volume
1354 dirNFErrdirNFErr -120 Directory not found
1355 afpObjectTypeErr -5025 Object was a file, not a directory; or,
1356 this directory is not a share point
1360 Also see: Share, FSpShare, Unshare
1363 /*****************************************************************************/
1373 The GetUGEntry function retrieves user or group entries from the
1376 objType input: The object type: -1 = group; 0 = user
1377 objName input: Points to a buffer (minimum Str31) where the user
1378 or group name is to be returned or must be nil.
1379 output: The user or group name.
1380 objID input: O to get the first user or group. If the entry objID
1381 last returned by GetUGEntry is passed, then user or
1382 group whose alphabetically next in the list of entries
1384 output: The user or group ID.
1388 fnfErr -43 No more users or groups
1389 paramErr -50 Function not supported; or, ioObjID is
1394 Also see: GetUGEntries
1397 /*****************************************************************************/
1399 #include "OptimizationEnd.h"
1401 #if PRAGMA_STRUCT_ALIGN
1402 #pragma options align=reset
1403 #elif PRAGMA_STRUCT_PACKPUSH
1405 #elif PRAGMA_STRUCT_PACK
1409 #ifdef PRAGMA_IMPORT_OFF
1412 #pragma import reset
1419 #endif /* __MOREFILES__ */