]> git.saurik.com Git - wxWidgets.git/blob - src/mac/morefile/MoreFile.h
#include textfile.h out of the WX_PRECOMP section (bcc)
[wxWidgets.git] / src / mac / morefile / MoreFile.h
1 /*
2 ** Apple Macintosh Developer Technical Support
3 **
4 ** The long lost high-level and FSSpec File Manager functions.
5 **
6 ** by Jim Luther, Apple Developer Technical Support Emeritus
7 **
8 ** File: MoreFiles.h
9 **
10 ** Copyright © 1992-1998 Apple Computer, Inc.
11 ** All rights reserved.
12 **
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.
20 */
21
22 #ifndef __MOREFILES__
23 #define __MOREFILES__
24
25 #include <Types.h>
26 #include <Files.h>
27
28 #ifndef true
29 #define true 1
30 #define false 0
31 #endif
32
33 #include "Optim.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /*****************************************************************************/
40
41 pascal OSErr HGetVolParms(ConstStr255Param volName,
42 short vRefNum,
43 GetVolParmsInfoBuffer *volParmsInfo,
44 long *infoSize);
45 /* ¦ Determine the characteristics of a volume.
46 The HGetVolParms function returns information about the characteristics
47 of a volume. A result of paramErr usually just means the volume doesn't
48 support PBHGetVolParms and the feature you were going to check
49 for isn't available.
50
51 volName input: A pointer to the name of a mounted volume
52 or nil.
53 vRefNum input: Volume specification.
54 volParmsInfo input: Pointer to GetVolParmsInfoBuffer where the
55 volume attributes information is returned.
56 output: Atributes information.
57 infoSize input: Size of buffer pointed to by volParmsInfo.
58 output: Size of data actually returned.
59
60 Result Codes
61 noErr 0 No error
62 nsvErr -35 Volume not found
63 paramErr -50 Volume doesn't support this function
64
65 __________
66
67 Also see the macros for checking attribute bits in MoreFilesExtras.h
68 */
69
70 /*****************************************************************************/
71
72 pascal OSErr HCreateMinimum(short vRefNum,
73 long dirID,
74 ConstStr255Param fileName);
75 /* ¦ Create a new file with no creator or file type.
76 The HCreateMinimum function creates a new file without attempting to set
77 the creator and file type of the new file. This function is needed to
78 create a file in an AppleShare "drop box" where the user can make
79 changes, but cannot see folder or files.
80
81 vRefNum input: Volume specification.
82 dirID input: Directory ID.
83 fileName input: The name of the new file.
84
85 Result Codes
86 noErr 0 No error
87 dirFulErr -33 File directory full
88 dskFulErr -34 Disk is full
89 nsvErr -35 No such volume
90 ioErr -36 I/O error
91 bdNamErr -37 Bad filename
92 fnfErr -43 Directory not found or incomplete pathname
93 wPrErr -44 Hardware volume lock
94 vLckdErr -46 Software volume lock
95 dupFNErr -48 Duplicate filename and version
96 dirNFErrdirNFErr -120 Directory not found or incomplete pathname
97 afpAccessDenied -5000 User does not have the correct access
98 afpObjectTypeErr -5025 A directory exists with that name
99
100 __________
101
102 Also see: FSpCreateMinimum
103 */
104
105 /*****************************************************************************/
106
107 pascal OSErr FSpCreateMinimum(const FSSpec *spec);
108 /* ¦ Create a new file with no creator or file type.
109 The FSpCreateMinimum function creates a new file without attempting to set
110 the the creator and file type of the new file. This function is needed to
111 create a file in an AppleShare "dropbox" where the user can make
112 changes, but cannot see folder or files.
113
114 spec input: An FSSpec record specifying the file to create.
115
116 Result Codes
117 noErr 0 No error
118 dirFulErr -33 File directory full
119 dskFulErr -34 Disk is full
120 nsvErr -35 No such volume
121 ioErr -36 I/O error
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
130
131 __________
132
133 Also see: HCreateMinimum
134 */
135
136 /*****************************************************************************/
137
138 pascal OSErr ExchangeFiles(short vRefNum,
139 long srcDirID,
140 ConstStr255Param srcName,
141 long dstDirID,
142 ConstStr255Param dstName);
143 /* ¦ Exchange the data stored in two files on the same volume.
144 The ExchangeFiles function swaps the data in two files on the same
145 volume by changing some of the information in the volume catalog and,
146 if the files are open, in the file control blocks.
147
148 vRefNum input: Volume specification.
149 srcDirID input: Source directory ID.
150 srcName input: Source file name.
151 dstDirID input: Destination directory ID.
152 dstName input: Destination file name.
153
154 Result Codes
155 noErr 0 No error
156 nsvErr -35 Volume not found
157 ioErr -36 I/O error
158 fnfErr -43 File not found
159 fLckdErr -45 File is locked
160 vLckdErr -46 Volume is locked or read-only
161 paramErr -50 Function not supported by volume
162 volOfflinErr -53 Volume is offline
163 wrgVolTypErr -123 Not an HFS volume
164 diffVolErr -1303 Files on different volumes
165 afpAccessDenied -5000 User does not have the correct access
166 afpObjectTypeErr -5025 Object is a directory, not a file
167 afpSameObjectErr -5038 Source and destination are the same
168
169 __________
170
171 Also see: FSpExchangeFilesCompat
172 */
173
174 /*****************************************************************************/
175
176 pascal OSErr ResolveFileIDRef(ConstStr255Param volName,
177 short vRefNum,
178 long fileID,
179 long *parID,
180 StringPtr fileName);
181 /* ¦ Retrieve the location of the file with the specified file ID reference.
182 The ResolveFileIDRef function returns the filename and parent directory ID
183 of the file with the specified file ID reference.
184
185 volName input: A pointer to the name of a mounted volume
186 or nil.
187 vRefNum input: Volume specification.
188 fileID input: The file ID reference.
189 parID output: The parent directory ID of the file.
190 name input: Points to a buffer (minimum Str63) where the filename
191 is to be returned or must be nil.
192 output: The filename.
193
194 Result Codes
195 noErr 0 No error
196 nsvErr -35 Volume not found
197 ioErr -36 I/O error
198 fnfErr -43 File not found
199 paramErr -50 Function not supported by volume
200 volOfflinErr -53 Volume is offline
201 extFSErr -58 External file system error - no file
202 system claimed this call.
203 wrgVolTypErr -123 Not an HFS volume
204 fidNotFoundErr -1300 File ID reference not found
205 notAFileErr -1302 Specified file is a directory
206 afpAccessDenied -5000 User does not have the correct access
207 afpObjectTypeErr -5025 Specified file is a directory
208 afpIDNotFound -5034 File ID reference not found
209 afpBadIDErr -5039 File ID reference not found
210
211 __________
212
213 Also see: FSpResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
214 DeleteFileIDRef
215 */
216
217 /*****************************************************************************/
218
219 pascal OSErr FSpResolveFileIDRef(ConstStr255Param volName,
220 short vRefNum,
221 long fileID,
222 FSSpecPtr spec);
223 /* ¦ Retrieve the location of the file with the specified file ID reference.
224 The FSpResolveFileIDRef function fills in an FSSpec with the location
225 of the file with the specified file ID reference.
226
227 volName input: A pointer to the name of a mounted volume
228 or nil.
229 vRefNum input: Volume specification.
230 fileID input: The file ID reference.
231 spec input: A pointer to a FSSpec record.
232 output: A file system specification to be filled in by
233 FSpResolveFileIDRef.
234
235 Result Codes
236 noErr 0 No error
237 nsvErr -35 Volume not found
238 ioErr -36 I/O error
239 fnfErr -43 File not found
240 paramErr -50 Function not supported by volume or
241 no default 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
252
253 __________
254
255 Also see: ResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
256 DeleteFileIDRef
257 */
258
259 /*****************************************************************************/
260
261 pascal OSErr CreateFileIDRef(short vRefNum,
262 long parID,
263 ConstStr255Param fileName,
264 long *fileID);
265 /* ¦ Establish a file ID reference for a file.
266 The CreateFileIDRef function creates a file ID reference for the
267 specified file, or if a file ID reference already exists, supplies
268 the file ID reference and returns the result code fidExists.
269
270 vRefNum input: Volume specification.
271 parID input: Directory ID.
272 fileName input: The name of the file.
273 fileID output: The file ID reference.
274
275 Result Codes
276 noErr 0 No error
277 nsvErr -35 Volume not found
278 ioErr -36 I/O error
279 fnfErr -43 File not found
280 wPrErr -44 Hardware volume lock
281 vLckdErr -46 Software volume lock
282 paramErr -50 Function not supported by volume
283 volOfflinErr -53 Volume is offline
284 extFSErr -58 External file system error - no file
285 system claimed this call.
286 wrgVolTypErr -123 Not an HFS volume
287 fidExists -1301 File ID reference already exists
288 notAFileErrn -1302 Specified file is a directory
289 afpAccessDenied -5000 User does not have the correct access
290 afpObjectTypeErr -5025 Specified file is a directory
291 afpIDExists -5035 File ID reference already exists
292
293 __________
294
295 Also see: FSpResolveFileIDRef, ResolveFileIDRef, FSpCreateFileIDRef,
296 DeleteFileIDRef
297 */
298
299 /*****************************************************************************/
300
301 pascal OSErr FSpCreateFileIDRef(const FSSpec *spec,
302 long *fileID);
303 /* ¦ Establish a file ID reference for a file.
304 The FSpCreateFileIDRef function creates a file ID reference for the
305 specified file, or if a file ID reference already exists, supplies
306 the file ID reference and returns the result code fidExists.
307
308 spec input: An FSSpec record specifying the file.
309 fileID output: The file ID reference.
310
311 Result Codes
312 noErr 0 No error
313 nsvErr -35 Volume not found
314 ioErr -36 I/O error
315 fnfErr -43 File not found
316 wPrErr -44 Hardware volume lock
317 vLckdErr -46 Software volume lock
318 paramErr -50 Function not supported by volume
319 volOfflinErr -53 Volume is offline
320 extFSErr -58 External file system error - no file
321 system claimed this call.
322 wrgVolTypErr -123 Not an HFS volume
323 fidExists -1301 File ID reference already exists
324 notAFileErrn -1302 Specified file is a directory
325 afpAccessDenied -5000 User does not have the correct access
326 afpObjectTypeErr -5025 Specified file is a directory
327 afpIDExists -5035 File ID reference already exists
328
329 __________
330
331 Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
332 DeleteFileIDRef
333 */
334
335 /*****************************************************************************/
336
337 pascal OSErr DeleteFileIDRef(ConstStr255Param volName,
338 short vRefNum,
339 long fileID);
340 /* ¦ Delete a file ID reference.
341 The DeleteFileIDRef function deletes a file ID reference.
342
343 volName input: A pointer to the name of a mounted volume
344 or nil.
345 vRefNum input: Volume specification.
346 fileID input: The file ID reference.
347
348 Result Codes
349 noErr 0 No error
350 nsvErr -35 Volume not found
351 ioErr -36 I/O error
352 fnfErr -43 File not found
353 wPrErr -44 Hardware volume lock
354 vLckdErr -46 Software volume lock
355 paramErr -50 Function not supported by volume
356 volOfflinErr -53 Volume is offline
357 extFSErr -58 External file system error - no file
358 system claimed this call.
359 wrgVolTypErr -123 Function is not supported by volume
360 fidNotFoundErr -1300 File ID reference not found
361 afpAccessDenied -5000 User does not have the correct access
362 afpObjectTypeErr -5025 Specified file is a directory
363 afpIDNotFound -5034 File ID reference not found
364
365 __________
366
367 Also see: FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
368 FSpCreateFileIDRef
369 */
370
371 /*****************************************************************************/
372
373 pascal OSErr FlushFile(short refNum);
374 /* ¦ Write the contents of a file's access path buffer (the fork data).
375 The FlushFile function writes the contents of a file's access path
376 buffer (the fork data) to the volume. Note: some of the file's catalog
377 information stored on the volume may not be correct until FlushVol
378 is called.
379
380 refNum input: The file reference number of an open file.
381
382 Result Codes
383 noErr 0 No error
384 nsvErr -35 Volume not found
385 ioErr -36 I/O error
386 fnOpnErr -38 File not open
387 fnfErr -43 File not found
388 rfNumErr -51 Bad reference number
389 extFSErr -58 External file system error - no file
390 system claimed this call.
391 */
392
393 /*****************************************************************************/
394
395 pascal OSErr LockRange(short refNum,
396 long rangeLength,
397 long rangeStart);
398 /* ¦ Lock a portion of a file.
399 The LockRange function locks (denies access to) a portion of a file
400 that was opened with shared read/write permission.
401
402 refNum input: The file reference number of an open file.
403 rangeLength input: The number of bytes in the range.
404 rangeStart input: The starting byte in the range to lock.
405
406 Result Codes
407 noErr 0 No error
408 ioErr -36 I/O error
409 fnOpnErr -38 File not open
410 eofErr -39 Logical end-of-file reached
411 fLckdErr -45 File is locked by another user
412 paramErr -50 Negative ioReqCount
413 rfNumErr -51 Bad reference number
414 extFSErr -58 External file system error - no file
415 system claimed this call.
416 volGoneErr -124 Server volume has been disconnected
417 afpNoMoreLocks -5015 No more ranges can be locked
418 afpRangeOverlap -5021 Part of range is already locked
419
420 __________
421
422 Also see: UnlockRange
423 */
424
425 /*****************************************************************************/
426
427 pascal OSErr UnlockRange(short refNum,
428 long rangeLength,
429 long rangeStart);
430 /* ¦ Unlock a previously locked range.
431 The UnlockRange function unlocks (allows access to) a previously locked
432 portion of a file that was opened with shared read/write permission.
433
434 refNum input: The file reference number of an open file.
435 rangeLength input: The number of bytes in the range.
436 rangeStart input: The starting byte in the range to unlock.
437
438 Result Codes
439 noErr 0 No error
440 ioErr -36 I/O error
441 fnOpnErr -38 File not open
442 eofErr -39 Logical end-of-file reached
443 paramErr -50 Negative ioReqCount
444 rfNumErr -51 Bad reference number
445 extFSErr -58 External file system error - no file
446 system claimed this call.
447 volGoneErr -124 Server volume has been disconnected
448 afpRangeNotLocked -5020 Specified range was not locked
449
450 __________
451
452 Also see: LockRange
453 */
454
455 /*****************************************************************************/
456
457 pascal OSErr GetForeignPrivs(short vRefNum,
458 long dirID,
459 ConstStr255Param name,
460 void *foreignPrivBuffer,
461 long *foreignPrivSize,
462 long *foreignPrivInfo1,
463 long *foreignPrivInfo2,
464 long *foreignPrivInfo3,
465 long *foreignPrivInfo4);
466 /* ¦ Retrieve the native access-control information.
467 The GetForeignPrivs function retrieves the native access-control
468 information for a file or directory stored on a volume managed by
469 a foreign file system.
470
471 vRefNum input: Volume specification.
472 dirID input: Directory ID.
473 name input: Pointer to object name, or nil when dirID
474 specifies a directory that's the object.
475 foreignPrivBuffer input: Pointer to buffer where the privilege
476 information is returned.
477 output: Privilege information.
478 foreignPrivSize input: Size of buffer pointed to by
479 foreignPrivBuffer.
480 output: Amount of buffer actually used.
481 foreignPrivInfo1 output: Information specific to privilege model.
482 foreignPrivInfo2 output: Information specific to privilege model.
483 foreignPrivInfo3 output: Information specific to privilege model.
484 foreignPrivInfo4 output: Information specific to privilege model.
485
486 Result Codes
487 noErr 0 No error
488 nsvErr -35 Volume not found
489 paramErr -50 Volume is HFS or MFS (that is, it has
490 no foreign privilege model), or foreign
491 volume does not support these calls
492
493 __________
494
495 Also see: FSpGetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
496 */
497
498 /*****************************************************************************/
499
500 pascal OSErr FSpGetForeignPrivs(const FSSpec *spec,
501 void *foreignPrivBuffer,
502 long *foreignPrivSize,
503 long *foreignPrivInfo1,
504 long *foreignPrivInfo2,
505 long *foreignPrivInfo3,
506 long *foreignPrivInfo4);
507 /* ¦ Retrieve the native access-control information.
508 The FSpGetForeignPrivs function retrieves the native access-control
509 information for a file or directory stored on a volume managed by
510 a foreign file system.
511
512 spec input: An FSSpec record specifying the object.
513 foreignPrivBuffer input: Pointer to buffer where the privilege
514 information is returned.
515 output: Privilege information.
516 foreignPrivSize input: Size of buffer pointed to by
517 foreignPrivBuffer.
518 output: Amount of buffer actually used.
519 foreignPrivInfo1 output: Information specific to privilege model.
520 foreignPrivInfo2 output: Information specific to privilege model.
521 foreignPrivInfo3 output: Information specific to privilege model.
522 foreignPrivInfo4 output: Information specific to privilege model.
523
524 Result Codes
525 noErr 0 No error
526 nsvErr -35 Volume not found
527 paramErr -50 Volume is HFS or MFS (that is, it has
528 no foreign privilege model), or foreign
529 volume does not support these calls
530
531 __________
532
533 Also see: GetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
534 */
535
536 /*****************************************************************************/
537
538 pascal OSErr SetForeignPrivs(short vRefNum,
539 long dirID,
540 ConstStr255Param name,
541 const void *foreignPrivBuffer,
542 long *foreignPrivSize,
543 long foreignPrivInfo1,
544 long foreignPrivInfo2,
545 long foreignPrivInfo3,
546 long foreignPrivInfo4);
547 /* ¦ Change the native access-control information.
548 The SetForeignPrivs function changes the native access-control
549 information for a file or directory stored on a volume managed by
550 a foreign file system.
551
552 vRefNum input: Volume specification.
553 dirID input: Directory ID.
554 name input: Pointer to object name, or nil when dirID
555 specifies a directory that's the object.
556 foreignPrivBuffer input: Pointer to privilege information buffer.
557 foreignPrivSize input: Size of buffer pointed to by
558 foreignPrivBuffer.
559 output: Amount of buffer actually used.
560 foreignPrivInfo1 input: Information specific to privilege model.
561 foreignPrivInfo2 input: Information specific to privilege model.
562 foreignPrivInfo3 input: Information specific to privilege model.
563 foreignPrivInfo4 input: Information specific to privilege model.
564
565 Result Codes
566 noErr 0 No error
567 nsvErr -35 Volume not found
568 paramErr -50 Volume is HFS or MFS (that is, it has
569 no foreign privilege model), or foreign
570 volume does not support these calls
571
572 __________
573
574 Also see: GetForeignPrivs, FSpGetForeignPrivs, FSpSetForeignPrivs
575 */
576
577 /*****************************************************************************/
578
579 pascal OSErr FSpSetForeignPrivs(const FSSpec *spec,
580 const void *foreignPrivBuffer,
581 long *foreignPrivSize,
582 long foreignPrivInfo1,
583 long foreignPrivInfo2,
584 long foreignPrivInfo3,
585 long foreignPrivInfo4);
586 /* ¦ Change the native access-control information.
587 The FSpSetForeignPrivs function changes the native access-control
588 information for a file or directory stored on a volume managed by
589 a foreign file system.
590
591 spec input: An FSSpec record specifying the object.
592 foreignPrivBuffer input: Pointer to privilege information buffer.
593 foreignPrivSize input: Size of buffer pointed to by
594 foreignPrivBuffer.
595 output: Amount of buffer actually used.
596 foreignPrivInfo1 input: Information specific to privilege model.
597 foreignPrivInfo2 input: Information specific to privilege model.
598 foreignPrivInfo3 input: Information specific to privilege model.
599 foreignPrivInfo4 input: Information specific to privilege model.
600
601 Result Codes
602 noErr 0 No error
603 nsvErr -35 Volume not found
604 paramErr -50 Volume is HFS or MFS (that is, it has
605 no foreign privilege model), or foreign
606 volume does not support these calls
607
608 __________
609
610 Also see: GetForeignPrivs, FSpGetForeignPrivs, SetForeignPrivs
611 */
612
613 /*****************************************************************************/
614
615 pascal OSErr HGetLogInInfo(ConstStr255Param volName,
616 short vRefNum,
617 short *loginMethod,
618 StringPtr userName);
619 /* ¦ Get the login method and user name used to log on to a shared volume.
620 The HGetLogInInfo function retrieves the login method and user name
621 used to log on to a particular shared volume.
622
623 volName input: A pointer to the name of a mounted volume
624 or nil.
625 vRefNum input: The volume reference number.
626 loginMethod output: The login method used (kNoUserAuthentication,
627 kPassword, kEncryptPassword, or
628 kTwoWayEncryptPassword).
629 userName input: Points to a buffer (minimum Str31) where the user
630 name is to be returned or must be nil.
631 output: The user name.
632
633 Result Codes
634 noErr 0 No error
635 nsvErr -35 Specified volume doesnÕt exist
636 paramErr -50 Function not supported by volume
637
638 __________
639
640 Also see: HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
641 FSpSetDirAccess, HMapName, HMapID
642 */
643
644 /*****************************************************************************/
645
646 pascal OSErr HGetDirAccess(short vRefNum,
647 long dirID,
648 ConstStr255Param name,
649 long *ownerID,
650 long *groupID,
651 long *accessRights);
652 /* ¦ Get a directory's access control information on a shared volume.
653 The HGetDirAccess function retrieves the directory access control
654 information for a directory on a shared volume.
655
656 vRefNum input: Volume specification.
657 dirID input: Directory ID.
658 name input: Pointer to directory name, or nil if dirID
659 specifies the directory.
660 ownerID output: The directory's owner ID.
661 groupID output: The directory's group ID or
662 0 if no group affiliation.
663 accessRights output: The directory's access rights.
664
665 Result Codes
666 noErr 0 No error
667 fnfErr -43 Directory not found
668 paramErr -50 Function not supported by volume
669 afpAccessDenied -5000 User does not have the correct access
670 to the directory
671
672 __________
673
674 Also see: HGetLogInInfo, FSpGetDirAccess, HSetDirAccess,
675 FSpSetDirAccess, HMapName, HMapID
676 */
677
678 /*****************************************************************************/
679
680 pascal OSErr FSpGetDirAccess(const FSSpec *spec,
681 long *ownerID,
682 long *groupID,
683 long *accessRights);
684 /* ¦ Get a directory's access control information on a shared volume.
685 The FSpGetDirAccess function retrieves the directory access control
686 information for a directory on a shared volume.
687
688 spec input: An FSSpec record specifying the directory.
689 ownerID output: The directory's owner ID.
690 groupID output: The directory's group ID or
691 0 if no group affiliation.
692 accessRights output: The directory's access rights.
693
694 Result Codes
695 noErr 0 No error
696 fnfErr -43 Directory not found
697 paramErr -50 Function not supported by volume
698 afpAccessDenied -5000 User does not have the correct access
699 to the directory
700
701 __________
702
703 Also see: HGetLogInInfo, HGetDirAccess, HSetDirAccess,
704 FSpSetDirAccess, HMapName, HMapID
705 */
706
707 /*****************************************************************************/
708
709 pascal OSErr HSetDirAccess(short vRefNum,
710 long dirID,
711 ConstStr255Param name,
712 long ownerID,
713 long groupID,
714 long accessRights);
715 /* ¦ Set a directory's access control information on a shared volume.
716 The HSetDirAccess function changes the directory access control
717 information for a directory on a shared volume. You must own a directory
718 to change its access control information.
719
720 vRefNum input: Volume specification.
721 dirID input: Directory ID.
722 name input: Pointer to directory name, or nil if dirID
723 specifies the directory.
724 ownerID input: The directory's owner ID.
725 groupID input: The directory's group ID or
726 0 if no group affiliation.
727 accessRights input: The directory's access rights.
728
729 Result Codes
730 noErr 0 No error
731 fnfErr -43 Directory not found
732 vLckdErr -46 Volume is locked or read-only
733 paramErr -50 Parameter error
734 afpAccessDenied -5000 User does not have the correct access
735 to the directory
736 afpObjectTypeErr -5025 Object is a file, not a directory
737
738 __________
739
740 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess,
741 FSpSetDirAccess, HMapName, HMapID
742 */
743
744 /*****************************************************************************/
745
746 pascal OSErr FSpSetDirAccess(const FSSpec *spec,
747 long ownerID,
748 long groupID,
749 long accessRights);
750 /* ¦ Set a directory's access control information on a shared volume.
751 The FSpSetDirAccess function changes the directory access control
752 information for a directory on a shared volume. You must own a directory
753 to change its access control information.
754
755 spec input: An FSSpec record specifying the directory.
756 ownerID input: The directory's owner ID.
757 groupID input: The directory's group ID or
758 0 if no group affiliation.
759 accessRights input: The directory's access rights.
760
761 Result Codes
762 noErr 0 No error
763 fnfErr -43 Directory not found
764 vLckdErr -46 Volume is locked or read-only
765 paramErr -50 Parameter error
766 afpAccessDenied -5000 User does not have the correct access
767 to the directory
768 afpObjectTypeErr -5025 Object is a file, not a directory
769
770 __________
771
772 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
773 HMapName, HMapID
774 */
775
776 /*****************************************************************************/
777
778 pascal OSErr HMapID(ConstStr255Param volName,
779 short vRefNum,
780 long ugID,
781 short objType,
782 StringPtr name);
783 /* ¦ Map a user or group ID to a user or group name.
784 The HMapID function determines the name of a user or group if you know
785 the user or group ID.
786
787 volName input: A pointer to the name of a mounted volume
788 or nil.
789 vRefNum input: Volume specification.
790 objType input: The mapping function code: 1 if you're mapping a
791 user ID to a user name or 2 if you're mapping a
792 group ID to a group name.
793 name input: Points to a buffer (minimum Str31) where the user
794 or group name is to be returned or must be nil.
795 output: The user or group name.
796
797 Result Codes
798 noErr 0 No error
799 fnfErr -43 Unrecognizable owner or group name
800 paramErr -50 Function not supported by volume
801
802 __________
803
804 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
805 FSpSetDirAccess, HMapName
806 */
807
808 /*****************************************************************************/
809
810 pascal OSErr HMapName(ConstStr255Param volName,
811 short vRefNum,
812 ConstStr255Param name,
813 short objType,
814 long *ugID);
815 /* ¦ Map a user or group name to a user or group ID.
816 The HMapName function determines the user or group ID if you know the
817 user or group name.
818
819 volName input: A pointer to the name of a mounted volume
820 or nil.
821 vRefNum input: Volume specification.
822 name input: The user or group name.
823 objType input: The mapping function code: 3 if you're mapping a
824 user name to a user ID or 4 if you're mapping a
825 group name to a group ID.
826 ugID output: The user or group ID.
827
828 Result Codes
829 noErr 0 No error
830 fnfErr -43 Unrecognizable owner or group name
831 paramErr -50 Function not supported by volume
832
833 __________
834
835 Also see: HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
836 FSpSetDirAccess, HMapID
837 */
838
839 /*****************************************************************************/
840
841 pascal OSErr HCopyFile(short srcVRefNum,
842 long srcDirID,
843 ConstStr255Param srcName,
844 short dstVRefNum,
845 long dstDirID,
846 ConstStr255Param dstPathname,
847 ConstStr255Param copyName);
848 /* ¦ Duplicate a file on a file server and optionally to rename it.
849 The HCopyFile function duplicates a file and optionally to renames it.
850 The source and destination volumes must be on the same file server.
851 This function instructs the server to copy the file.
852
853 srcVRefNum input: Source volume specification.
854 srcDirID input: Source directory ID.
855 srcName input: Source file name.
856 dstVRefNum input: Destination volume specification.
857 dstDirID input: Destination directory ID.
858 dstPathname input: Pointer to destination directory name, or
859 nil when dstDirID specifies a directory.
860 copyName input: Points to the new file name if the file is to be
861 renamed or nil if the file isn't to be renamed.
862
863 Result Codes
864 noErr 0 No error
865 dskFulErr -34 Destination volume is full
866 fnfErr -43 Source file not found, or destination
867 directory does not exist
868 vLckdErr -46 Destination volume is read-only
869 fBsyErr -47 The source or destination file could
870 not be opened with the correct access
871 modes
872 dupFNErr -48 Destination file already exists
873 paramErr -50 Function not supported by volume
874 wrgVolTypErr -123 Function not supported by volume
875 afpAccessDenied -5000 The user does not have the right to
876 read the source or write to the
877 destination
878 afpDenyConflict -5006 The source or destination file could
879 not be opened with the correct access
880 modes
881 afpObjectTypeErr -5025 Source is a directory
882
883 __________
884
885 Also see: FSpCopyFile, FileCopy, FSpFileCopy
886 */
887
888 /*****************************************************************************/
889
890 pascal OSErr FSpCopyFile(const FSSpec *srcSpec,
891 const FSSpec *dstSpec,
892 ConstStr255Param copyName);
893 /* ¦ Duplicate a file on a file server and optionally to rename it.
894 The FSpCopyFile function duplicates a file and optionally to renames it.
895 The source and destination volumes must be on the same file server.
896 This function instructs the server to copy the file.
897
898 srcSpec input: An FSSpec record specifying the source file.
899 dstSpec input: An FSSpec record specifying the destination
900 directory.
901 copyName input: Points to the new file name if the file is to be
902 renamed or nil if the file isn't to be renamed.
903
904 Result Codes
905 noErr 0 No error
906 dskFulErr -34 Destination volume is full
907 fnfErr -43 Source file not found, or destination
908 directory does not exist
909 vLckdErr -46 Destination volume is read-only
910 fBsyErr -47 The source or destination file could
911 not be opened with the correct access
912 modes
913 dupFNErr -48 Destination file already exists
914 paramErr -50 Function not supported by volume
915 wrgVolTypErr -123 Function not supported by volume
916 afpAccessDenied -5000 The user does not have the right to
917 read the source or write to the
918 destination
919 afpDenyConflict -5006 The source or destination file could
920 not be opened with the correct access
921 modes
922 afpObjectTypeErr -5025 Source is a directory
923
924 __________
925
926 Also see: HCopyFile, FileCopy, FSpFileCopy
927 */
928
929 /*****************************************************************************/
930
931 pascal OSErr HMoveRename(short vRefNum,
932 long srcDirID,
933 ConstStr255Param srcName,
934 long dstDirID,
935 ConstStr255Param dstpathName,
936 ConstStr255Param copyName);
937 /* ¦ Move a file or directory on a file server and optionally to rename it.
938 The HMoveRename function moves a file or directory and optionally
939 renames it. The source and destination locations must be on the same
940 shared volume.
941
942 vRefNum input: Volume specification.
943 srcDirID input: Source directory ID.
944 srcName input: The source object name.
945 dstDirID input: Destination directory ID.
946 dstName input: Pointer to destination directory name, or
947 nil when dstDirID specifies a directory.
948 copyName input: Points to the new name if the object is to be
949 renamed or nil if the object isn't to be renamed.
950
951 Result Codes
952 noErr 0 No error
953 fnfErr -43 Source file or directory not found
954 fLckdErr -45 File is locked
955 vLckdErr -46 Destination volume is read-only
956 dupFNErr -48 Destination already exists
957 paramErr -50 Function not supported by volume
958 badMovErr -122 Attempted to move directory into
959 offspring
960 afpAccessDenied -5000 The user does not have the right to
961 move the file or directory
962
963 __________
964
965 Also see: FSpMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
966 */
967
968 /*****************************************************************************/
969
970 pascal OSErr FSpMoveRename(const FSSpec *srcSpec,
971 const FSSpec *dstSpec,
972 ConstStr255Param copyName);
973 /* ¦ Move a file or directory on a file server and optionally to rename it.
974 The FSpMoveRename function moves a file or directory and optionally
975 renames it. The source and destination locations must be on the same
976 shared volume.
977
978 srcSpec input: An FSSpec record specifying the source object.
979 dstSpec input: An FSSpec record specifying the destination
980 directory.
981 copyName input: Points to the new name if the object is to be
982 renamed or nil if the object isn't to be renamed.
983
984 Result Codes
985 noErr 0 No error
986 fnfErr -43 Source file or directory not found
987 fLckdErr -45 File is locked
988 vLckdErr -46 Destination volume is read-only
989 dupFNErr -48 Destination already exists
990 paramErr -50 Function not supported by volume
991 badMovErr -122 Attempted to move directory into
992 offspring
993 afpAccessDenied -5000 The user does not have the right to
994 move the file or directory
995
996 __________
997
998 Also see: HMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
999 */
1000
1001 /*****************************************************************************/
1002
1003 pascal OSErr GetVolMountInfoSize(ConstStr255Param volName,
1004 short vRefNum,
1005 short *size);
1006 /* ¦ Get the size of a volume mounting information record.
1007 The GetVolMountInfoSize function determines the how much space the
1008 program needs to allocate for a volume mounting information record.
1009
1010 volName input: A pointer to the name of a mounted volume
1011 or nil.
1012 vRefNum input: Volume specification.
1013 size output: The space needed (in bytes) of the volume mounting
1014 information record.
1015
1016 Result Codes
1017 noErr 0 No error
1018 nsvErr -35 Volume not found
1019 paramErr -50 Parameter error
1020 extFSErr -58 External file system error - no file
1021 system claimed this call.
1022
1023 __________
1024
1025 Also see: GetVolMountInfo, VolumeMount BuildAFPVolMountInfo,
1026 RetrieveAFPVolMountInfo
1027 */
1028
1029 /*****************************************************************************/
1030
1031 pascal OSErr GetVolMountInfo(ConstStr255Param volName,
1032 short vRefNum,
1033 void *volMountInfo);
1034 /* ¦ Retrieve a volume mounting information record.
1035 The GetVolMountInfo function retrieves a volume mounting information
1036 record containing all the information needed to mount the volume,
1037 except for passwords.
1038
1039 volName input: A pointer to the name of a mounted volume
1040 or nil.
1041 vRefNum input: Volume specification.
1042 volMountInfo output: Points to a volume mounting information
1043 record where the mounting information is to
1044 be returned.
1045
1046 Result Codes
1047 noErr 0 No error
1048 nsvErr -35 Volume not found
1049 paramErr -50 Parameter error
1050 extFSErr -58 External file system error - no file
1051 system claimed this call.
1052
1053 __________
1054
1055 Also see: GetVolMountInfoSize, VolumeMount, BuildAFPVolMountInfo,
1056 RetrieveAFPVolMountInfo
1057 */
1058
1059 /*****************************************************************************/
1060
1061 pascal OSErr VolumeMount(const void *volMountInfo,
1062 short *vRefNum);
1063 /* ¦ Mount a volume using a volume mounting information record.
1064 The VolumeMount function mounts a volume using a volume mounting
1065 information record.
1066
1067 volMountInfo input: Points to a volume mounting information record.
1068 vRefNum output: A volume reference number.
1069
1070 Result Codes
1071 noErr 0 No error
1072 notOpenErr -28 AppleTalk is not open
1073 nsvErr -35 Volume not found
1074 paramErr -50 Parameter error; typically, zone, server,
1075 and volume name combination is not valid
1076 or not complete, or the user name is not
1077 recognized
1078 extFSErr -58 External file system error - no file
1079 system claimed this call.
1080 memFullErr -108 Not enough memory to create a new volume
1081 control block for mounting the volume
1082 afpBadUAM -5002 User authentication method is unknown
1083 afpBadVersNum -5003 Workstation is using an AFP version that
1084 the server doesnÕt recognize
1085 afpNoServer -5016 Server is not responding
1086 afpUserNotAuth -5023 User authentication failed (usually,
1087 password is not correct)
1088 afpPwdExpired -5042 Password has expired on server
1089 afpBadDirIDType -5060 Not a fixed directory ID volume
1090 afpCantMountMoreSrvrs -5061 Maximum number of volumes has been
1091 mounted
1092 afpAlreadyMounted -5062 Volume already mounted
1093 afpSameNodeErr -5063 Attempt to log on to a server running
1094 on the same machine
1095
1096 __________
1097
1098 Also see: GetVolMountInfoSize, GetVolMountInfo, BuildAFPVolMountInfo,
1099 RetrieveAFPVolMountInfo
1100 */
1101
1102 /*****************************************************************************/
1103
1104 pascal OSErr Share(short vRefNum,
1105 long dirID,
1106 ConstStr255Param name);
1107 /* ¦ Establish a local volume or directory as a share point.
1108 The Share function establishes a local volume or directory as a
1109 share point.
1110
1111 vRefNum input: Volume specification.
1112 dirID input: Directory ID.
1113 name input: Pointer to directory name, or nil if dirID
1114 specifies the directory.
1115
1116 Result Codes
1117 noErr 0 No error
1118 tmfoErr -42 Too many share points
1119 fnfErr -43 File not found
1120 dupFNErr -48 Already a share point with this name
1121 paramErr -50 Function not supported by volume
1122 dirNFErrdirNFErr -120 Directory not found
1123 afpAccessDenied -5000 This directory cannot be shared
1124 afpObjectTypeErr -5025 Object was a file, not a directory
1125 afpContainsSharedErr -5033 The directory contains a share point
1126 afpInsideSharedErr -5043 The directory is inside a shared directory
1127
1128 __________
1129
1130 Also see: FSpShare, Unshare, FSpUnshare
1131 */
1132
1133 /*****************************************************************************/
1134
1135 pascal OSErr FSpShare(const FSSpec *spec);
1136 /* ¦ Establish a local volume or directory as a share point.
1137 The FSpShare function establishes a local volume or directory as a
1138 share point.
1139
1140 spec input: An FSSpec record specifying the share point.
1141
1142 Result Codes
1143 noErr 0 No error
1144 tmfoErr -42 Too many share points
1145 fnfErr -43 File not found
1146 dupFNErr -48 Already a share point with this name
1147 paramErr -50 Function not supported by volume
1148 dirNFErrdirNFErr -120 Directory not found
1149 afpAccessDenied -5000 This directory cannot be shared
1150 afpObjectTypeErr -5025 Object was a file, not a directory
1151 afpContainsSharedErr -5033 The directory contains a share point
1152 afpInsideSharedErr -5043 The directory is inside a shared directory
1153
1154 __________
1155
1156 Also see: Share, Unshare, FSpUnshare
1157 */
1158
1159 /*****************************************************************************/
1160
1161 pascal OSErr Unshare(short vRefNum,
1162 long dirID,
1163 ConstStr255Param name);
1164 /* ¦ Remove a share point.
1165 The Unshare function removes a share point.
1166
1167 vRefNum input: Volume specification.
1168 dirID input: Directory ID.
1169 name input: Pointer to directory name, or nil if dirID
1170 specifies the directory.
1171
1172 Result Codes
1173 noErr 0 No error
1174 fnfErr -43 File not found
1175 paramErr -50 Function not supported by volume
1176 dirNFErrdirNFErr -120 Directory not found
1177 afpObjectTypeErr -5025 Object was a file, not a directory; or,
1178 this directory is not a share point
1179
1180 __________
1181
1182 Also see: Share, FSpShare, FSpUnshare
1183 */
1184
1185 /*****************************************************************************/
1186
1187 pascal OSErr FSpUnshare(const FSSpec *spec);
1188 /* ¦ Remove a share point.
1189 The FSpUnshare function removes a share point.
1190
1191 spec input: An FSSpec record specifying the share point.
1192
1193 Result Codes
1194 noErr 0 No error
1195 fnfErr -43 File not found
1196 paramErr -50 Function not supported by volume
1197 dirNFErrdirNFErr -120 Directory not found
1198 afpObjectTypeErr -5025 Object was a file, not a directory; or,
1199 this directory is not a share point
1200
1201 __________
1202
1203 Also see: Share, FSpShare, Unshare
1204 */
1205
1206 /*****************************************************************************/
1207
1208 pascal OSErr GetUGEntry(short objType,
1209 StringPtr objName,
1210 long *objID);
1211 /* ¦ Retrieve a user or group entry from the local file server.
1212 The GetUGEntry function retrieves user or group entries from the
1213 local file server.
1214
1215 objType input: The object type: -1 = group; 0 = user
1216 objName input: Points to a buffer (minimum Str31) where the user
1217 or group name is to be returned or must be nil.
1218 output: The user or group name.
1219 objID input: O to get the first user or group. If the entry objID
1220 last returned by GetUGEntry is passed, then user or
1221 group whose alphabetically next in the list of entries
1222 is returned.
1223 output: The user or group ID.
1224
1225 Result Codes
1226 noErr 0 No error
1227 fnfErr -43 No more users or groups
1228 paramErr -50 Function not supported; or, ioObjID is
1229 negative
1230
1231 __________
1232
1233 Also see: GetUGEntries
1234 */
1235
1236 /*****************************************************************************/
1237
1238 #ifdef __cplusplus
1239 }
1240 #endif
1241
1242 #include "OptimEnd.h"
1243
1244 #endif /* __MOREFILES__ */