MoreFiles.h

Go to the documentation of this file.
00001 
00002 /*  $Id: MoreFiles.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /*
00005     File:       MoreFiles.h
00006     
00007     Description:The long lost high-level and FSSpec File Manager functions.
00008 
00009     Author:     JL
00010 
00011     Copyright:  Copyright: © 1992-1999 by Apple Computer, Inc.
00012                 all rights reserved.
00013     
00014     Disclaimer: You may incorporate this sample code into your applications without
00015                 restriction, though the sample code has been provided "AS IS" and the
00016                 responsibility for its operation is 100% yours.  However, what you are
00017                 not permitted to do is to redistribute the source as "DSC Sample Code"
00018                 after having made changes. If you're going to re-distribute the source,
00019                 we require that you make it clear in the source that the code was
00020                 descended from Apple Sample Code, but that you've made changes.
00021     
00022     Change History (most recent first):
00023                 6/25/99 Updated for Metrowerks Codewarror Pro 2.1(KG)
00024 
00025 */
00026 
00027 
00028 #ifndef __MOREFILES__
00029 #define __MOREFILES__
00030 
00031 #include <Types.h>
00032 #include <Files.h>
00033 
00034 #include "Optimization.h"
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 /*****************************************************************************/
00041 
00042 pascal  OSErr   HGetVolParms(ConstStr255Param volName,
00043                              short vRefNum,
00044                              GetVolParmsInfoBuffer *volParmsInfo,
00045                              long *infoSize);
00046 /*  ¦ Determine the characteristics of a volume.
00047     The HGetVolParms function returns information about the characteristics
00048     of a volume. A result of paramErr usually just means the volume doesn't
00049     support PBHGetVolParms and the feature you were going to check
00050     for isn't available.
00051 
00052     volName         input:  A pointer to the name of a mounted volume
00053                             or nil.
00054     vRefNum         input:  Volume specification.
00055     volParmsInfo    input:  Pointer to GetVolParmsInfoBuffer where the
00056                             volume attributes information is returned.
00057                     output: Atributes information.
00058     infoSize        input:  Size of buffer pointed to by volParmsInfo.
00059                     output: Size of data actually returned.
00060     
00061     Result Codes
00062         noErr               0       No error
00063         nsvErr              -35     Volume not found
00064         paramErr            -50     Volume doesn't support this function
00065     
00066     __________
00067     
00068     Also see the macros for checking attribute bits in MoreFilesExtras.h
00069 */
00070 
00071 /*****************************************************************************/
00072 
00073 pascal  OSErr   HCreateMinimum(short vRefNum,
00074                                long dirID,
00075                                ConstStr255Param fileName);
00076 /*  ¦ Create a new file with no creator or file type.
00077     The HCreateMinimum function creates a new file without attempting to set
00078     the creator and file type of the new file.  This function is needed to
00079     create a file in an AppleShare "drop box" where the user can make
00080     changes, but cannot see folder or files.
00081     
00082     vRefNum     input:  Volume specification.
00083     dirID       input:  Directory ID.
00084     fileName    input:  The name of the new file.
00085     
00086     Result Codes
00087         noErr               0       No error
00088         dirFulErr           -33     File directory full
00089         dskFulErr           -34     Disk is full
00090         nsvErr              -35     No such volume
00091         ioErr               -36     I/O error
00092         bdNamErr            -37     Bad filename
00093         fnfErr              -43     Directory not found or incomplete pathname
00094         wPrErr              -44     Hardware volume lock
00095         vLckdErr            -46     Software volume lock
00096         dupFNErr            -48     Duplicate filename and version
00097         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
00098         afpAccessDenied     -5000   User does not have the correct access
00099         afpObjectTypeErr    -5025   A directory exists with that name
00100     
00101     __________
00102     
00103     Also see:   FSpCreateMinimum
00104 */
00105 
00106 /*****************************************************************************/
00107 
00108 pascal  OSErr   FSpCreateMinimum(const FSSpec *spec);
00109 /*  ¦ Create a new file with no creator or file type.
00110     The FSpCreateMinimum function creates a new file without attempting to set 
00111     the the creator and file type of the new file.  This function is needed to
00112     create a file in an AppleShare "dropbox" where the user can make
00113     changes, but cannot see folder or files. 
00114     
00115     spec        input:  An FSSpec record specifying the file to create.
00116     
00117     Result Codes
00118         noErr               0       No error
00119         dirFulErr           -33     File directory full
00120         dskFulErr           -34     Disk is full
00121         nsvErr              -35     No such volume
00122         ioErr               -36     I/O error
00123         bdNamErr            -37     Bad filename
00124         fnfErr              -43     Directory not found or incomplete pathname
00125         wPrErr              -44     Hardware volume lock
00126         vLckdErr            -46     Software volume lock
00127         dupFNErr            -48     Duplicate filename and version
00128         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
00129         afpAccessDenied     -5000   User does not have the correct access
00130         afpObjectTypeErr    -5025   A directory exists with that name
00131     
00132     __________
00133     
00134     Also see:   HCreateMinimum
00135 */
00136 
00137 /*****************************************************************************/
00138 
00139 pascal  OSErr   ExchangeFiles(short vRefNum,
00140                               long srcDirID,
00141                               ConstStr255Param srcName,
00142                               long dstDirID,
00143                               ConstStr255Param dstName);
00144 /*  ¦ Exchange the data stored in two files on the same volume.
00145     The ExchangeFiles function swaps the data in two files on the same
00146     volume by changing some of the information in the volume catalog and,
00147     if the files are open, in the file control blocks.
00148 
00149     vRefNum     input:  Volume specification.
00150     srcDirID    input:  Source directory ID.
00151     srcName     input:  Source file name.
00152     dstDirID    input:  Destination directory ID.
00153     dstName     input:  Destination file name.
00154     
00155     Result Codes
00156         noErr               0       No error
00157         nsvErr              -35     Volume not found
00158         ioErr               -36     I/O error
00159         fnfErr              -43     File not found
00160         fLckdErr            -45     File is locked
00161         vLckdErr            -46     Volume is locked or read-only
00162         paramErr            -50     Function not supported by volume
00163         volOfflinErr        -53     Volume is offline
00164         wrgVolTypErr        -123    Not an HFS volume
00165         diffVolErr          -1303   Files on different volumes
00166         afpAccessDenied     -5000   User does not have the correct access
00167         afpObjectTypeErr    -5025   Object is a directory, not a file
00168         afpSameObjectErr    -5038   Source and destination are the same
00169 
00170     __________
00171     
00172     Also see:   FSpExchangeFilesCompat
00173 */
00174 
00175 /*****************************************************************************/
00176 
00177 pascal  OSErr   ResolveFileIDRef(ConstStr255Param volName,
00178                                  short vRefNum,
00179                                  long fileID,
00180                                  long *parID,
00181                                  StringPtr fileName);
00182 /*  ¦ Retrieve the location of the file with the specified file ID reference.
00183     The ResolveFileIDRef function returns the filename and parent directory ID
00184     of the file with the specified file ID reference.
00185     
00186     volName input:  A pointer to the name of a mounted volume
00187                     or nil.
00188     vRefNum input:  Volume specification.
00189     fileID  input:  The file ID reference.
00190     parID   output: The parent directory ID of the file.
00191     name    input:  Points to a buffer (minimum Str63) where the filename
00192                     is to be returned or must be nil.
00193             output: The filename.
00194     
00195     Result Codes
00196         noErr               0       No error
00197         nsvErr              -35     Volume not found
00198         ioErr               -36     I/O error
00199         fnfErr              -43     File not found
00200         paramErr            -50     Function not supported by volume
00201         volOfflinErr        -53     Volume is offline
00202         extFSErr            -58     External file system error - no file
00203                                     system claimed this call.
00204         wrgVolTypErr        -123    Not an HFS volume
00205         fidNotFoundErr      -1300   File ID reference not found
00206         notAFileErr         -1302   Specified file is a directory
00207         afpAccessDenied     -5000   User does not have the correct access
00208         afpObjectTypeErr    -5025   Specified file is a directory
00209         afpIDNotFound       -5034   File ID reference not found
00210         afpBadIDErr         -5039   File ID reference not found
00211     
00212     __________
00213     
00214     Also see:   FSpResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
00215                 DeleteFileIDRef
00216 */
00217 
00218 /*****************************************************************************/
00219 
00220 pascal  OSErr   FSpResolveFileIDRef(ConstStr255Param volName,
00221                                     short vRefNum,
00222                                     long fileID,
00223                                     FSSpecPtr spec);
00224 /*  ¦ Retrieve the location of the file with the specified file ID reference.
00225     The FSpResolveFileIDRef function fills in an FSSpec with the location
00226     of the file with the specified file ID reference.
00227     
00228     volName input:  A pointer to the name of a mounted volume
00229                     or nil.
00230     vRefNum input:  Volume specification.
00231     fileID  input:  The file ID reference.
00232     spec    input:  A pointer to a FSSpec record.
00233             output: A file system specification to be filled in by
00234                     FSpResolveFileIDRef.
00235     
00236     Result Codes
00237         noErr               0       No error
00238         nsvErr              -35     Volume not found
00239         ioErr               -36     I/O error
00240         fnfErr              -43     File not found
00241         paramErr            -50     Function not supported by volume or
00242                                     no default volume
00243         volOfflinErr        -53     Volume is offline
00244         extFSErr            -58     External file system error - no file
00245                                     system claimed this call.
00246         wrgVolTypErr        -123    Not an HFS volume
00247         fidNotFoundErr      -1300   File ID reference not found
00248         notAFileErr         -1302   Specified file is a directory
00249         afpAccessDenied     -5000   User does not have the correct access
00250         afpObjectTypeErr    -5025   Specified file is a directory
00251         afpIDNotFound       -5034   File ID reference not found
00252         afpBadIDErr         -5039   File ID reference not found
00253     
00254     __________
00255     
00256     Also see:   ResolveFileIDRef, CreateFileIDRef, FSpCreateFileIDRef,
00257                 DeleteFileIDRef
00258 */
00259 
00260 /*****************************************************************************/
00261 
00262 pascal  OSErr   CreateFileIDRef(short vRefNum,
00263                                 long parID,
00264                                 ConstStr255Param fileName,
00265                                 long *fileID);
00266 /*  ¦ Establish a file ID reference for a file.
00267     The CreateFileIDRef function creates a file ID reference for the
00268     specified file, or if a file ID reference already exists, supplies
00269     the file ID reference and returns the result code fidExists or afpIDExists.
00270 
00271     vRefNum     input:  Volume specification.
00272     parID       input:  Directory ID.
00273     fileName    input:  The name of the file.
00274     fileID      output: The file ID reference (if result is noErr,
00275                         fidExists, or afpIDExists).
00276     
00277     Result Codes
00278         noErr               0       No error
00279         nsvErr              -35     Volume not found
00280         ioErr               -36     I/O error
00281         fnfErr              -43     File not found
00282         wPrErr              -44     Hardware volume lock
00283         vLckdErr            -46     Software volume lock
00284         paramErr            -50     Function not supported by volume
00285         volOfflinErr        -53     Volume is offline
00286         extFSErr            -58     External file system error - no file
00287                                     system claimed this call.
00288         wrgVolTypErr        -123    Not an HFS volume
00289         fidExists           -1301   File ID reference already exists
00290         notAFileErrn        -1302   Specified file is a directory
00291         afpAccessDenied     -5000   User does not have the correct access
00292         afpObjectTypeErr    -5025   Specified file is a directory
00293         afpIDExists         -5035   File ID reference already exists
00294     
00295     __________
00296     
00297     Also see:   FSpResolveFileIDRef, ResolveFileIDRef, FSpCreateFileIDRef,
00298                 DeleteFileIDRef
00299 */
00300 
00301 /*****************************************************************************/
00302 
00303 pascal  OSErr   FSpCreateFileIDRef(const FSSpec *spec,
00304                                    long *fileID);
00305 /*  ¦ Establish a file ID reference for a file.
00306     The FSpCreateFileIDRef function creates a file ID reference for the
00307     specified file, or if a file ID reference already exists, supplies
00308     the file ID reference and returns the result code fidExists or afpIDExists.
00309 
00310     spec        input:  An FSSpec record specifying the file.
00311     fileID      output: The file ID reference (if result is noErr,
00312                         fidExists, or afpIDExists).
00313     
00314     Result Codes
00315         noErr               0       No error
00316         nsvErr              -35     Volume not found
00317         ioErr               -36     I/O error
00318         fnfErr              -43     File not found
00319         wPrErr              -44     Hardware volume lock
00320         vLckdErr            -46     Software volume lock
00321         paramErr            -50     Function not supported by volume
00322         volOfflinErr        -53     Volume is offline
00323         extFSErr            -58     External file system error - no file
00324                                     system claimed this call.
00325         wrgVolTypErr        -123    Not an HFS volume
00326         fidExists           -1301   File ID reference already exists
00327         notAFileErrn        -1302   Specified file is a directory
00328         afpAccessDenied     -5000   User does not have the correct access
00329         afpObjectTypeErr    -5025   Specified file is a directory
00330         afpIDExists         -5035   File ID reference already exists
00331     
00332     __________
00333     
00334     Also see:   FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
00335                 DeleteFileIDRef
00336 */
00337 
00338 /*****************************************************************************/
00339 
00340 pascal  OSErr   DeleteFileIDRef(ConstStr255Param volName,
00341                                 short vRefNum,
00342                                 long fileID);
00343 /*  ¦ Delete a file ID reference.
00344     The DeleteFileIDRef function deletes a file ID reference.
00345 
00346     volName input:  A pointer to the name of a mounted volume
00347                     or nil.
00348     vRefNum input:  Volume specification.
00349     fileID  input:  The file ID reference.
00350     
00351     Result Codes
00352         noErr               0       No error
00353         nsvErr              -35     Volume not found
00354         ioErr               -36     I/O error
00355         fnfErr              -43     File not found
00356         wPrErr              -44     Hardware volume lock
00357         vLckdErr            -46     Software volume lock
00358         paramErr            -50     Function not supported by volume
00359         volOfflinErr        -53     Volume is offline
00360         extFSErr            -58     External file system error - no file
00361                                     system claimed this call.
00362         wrgVolTypErr        -123    Function is not supported by volume
00363         fidNotFoundErr      -1300   File ID reference not found
00364         afpAccessDenied     -5000   User does not have the correct access
00365         afpObjectTypeErr    -5025   Specified file is a directory
00366         afpIDNotFound       -5034   File ID reference not found
00367     
00368     __________
00369     
00370     Also see:   FSpResolveFileIDRef, ResolveFileIDRef, CreateFileIDRef,
00371                 FSpCreateFileIDRef
00372 */
00373 
00374 /*****************************************************************************/
00375 
00376 pascal  OSErr   FlushFile(short refNum);
00377 /*  ¦ Write the contents of a file's access path buffer (the fork data).
00378     The FlushFile function writes the contents of a file's access path
00379     buffer (the fork data) to the volume. Note: some of the file's catalog
00380     information stored on the volume may not be correct until FlushVol
00381     is called.
00382 
00383     refNum  input:  The file reference number of an open file.
00384     
00385     Result Codes
00386         noErr               0       No error
00387         nsvErr              -35     Volume not found
00388         ioErr               -36     I/O error
00389         fnOpnErr            -38     File not open
00390         fnfErr              -43     File not found
00391         rfNumErr            -51     Bad reference number
00392         extFSErr            -58     External file system error - no file
00393                                     system claimed this call.
00394 */
00395 
00396 /*****************************************************************************/
00397 
00398 pascal  OSErr   LockRange(short refNum,
00399                           long rangeLength,
00400                           long rangeStart);
00401 /*  ¦ Lock a portion of a file.
00402     The LockRange function locks (denies access to) a portion of a file
00403     that was opened with shared read/write permission.
00404 
00405     refNum      input:  The file reference number of an open file.
00406     rangeLength input:  The number of bytes in the range.
00407     rangeStart  input:  The starting byte in the range to lock.
00408     
00409     Result Codes
00410         noErr               0       No error
00411         ioErr               -36     I/O error
00412         fnOpnErr            -38     File not open
00413         eofErr              -39     Logical end-of-file reached
00414         fLckdErr            -45     File is locked by another user
00415         paramErr            -50     Negative ioReqCount
00416         rfNumErr            -51     Bad reference number
00417         extFSErr            -58     External file system error - no file
00418                                     system claimed this call.
00419         volGoneErr          -124    Server volume has been disconnected
00420         afpNoMoreLocks      -5015   No more ranges can be locked
00421         afpRangeOverlap     -5021   Part of range is already locked
00422 
00423     __________
00424     
00425     Also see:   UnlockRange
00426 */
00427 
00428 /*****************************************************************************/
00429 
00430 pascal  OSErr   UnlockRange(short refNum,
00431                             long rangeLength,
00432                             long rangeStart);
00433 /*  ¦ Unlock a previously locked range.
00434     The UnlockRange function unlocks (allows access to) a previously locked
00435     portion of a file that was opened with shared read/write permission.
00436 
00437     refNum      input:  The file reference number of an open file.
00438     rangeLength input:  The number of bytes in the range.
00439     rangeStart  input:  The starting byte in the range to unlock.
00440     
00441     Result Codes
00442         noErr               0       No error
00443         ioErr               -36     I/O error
00444         fnOpnErr            -38     File not open
00445         eofErr              -39     Logical end-of-file reached
00446         paramErr            -50     Negative ioReqCount
00447         rfNumErr            -51     Bad reference number
00448         extFSErr            -58     External file system error - no file
00449                                     system claimed this call.
00450         volGoneErr          -124    Server volume has been disconnected
00451         afpRangeNotLocked   -5020   Specified range was not locked
00452 
00453     __________
00454     
00455     Also see:   LockRange
00456 */
00457 
00458 /*****************************************************************************/
00459 
00460 pascal  OSErr   GetForeignPrivs(short vRefNum,
00461                                 long dirID,
00462                                 ConstStr255Param name,
00463                                 void *foreignPrivBuffer,
00464                                 long *foreignPrivSize,
00465                                 long *foreignPrivInfo1,
00466                                 long *foreignPrivInfo2,
00467                                 long *foreignPrivInfo3,
00468                                 long *foreignPrivInfo4);
00469 /*  ¦ Retrieve the native access-control information.
00470     The GetForeignPrivs function retrieves the native access-control
00471     information for a file or directory stored on a volume managed by
00472     a foreign file system.
00473     
00474     vRefNum             input:  Volume specification.
00475     dirID               input:  Directory ID.
00476     name                input:  Pointer to object name, or nil when dirID
00477                                 specifies a directory that's the object.
00478     foreignPrivBuffer   input:  Pointer to buffer where the privilege
00479                                 information is returned.
00480                         output: Privilege information.
00481     foreignPrivSize     input:  Size of buffer pointed to by
00482                                 foreignPrivBuffer.
00483                         output: Amount of buffer actually used.
00484     foreignPrivInfo1    output: Information specific to privilege model.
00485     foreignPrivInfo2    output: Information specific to privilege model.
00486     foreignPrivInfo3    output: Information specific to privilege model.
00487     foreignPrivInfo4    output: Information specific to privilege model.
00488     
00489     Result Codes
00490         noErr               0       No error
00491         nsvErr              -35     Volume not found
00492         paramErr            -50     Volume is HFS or MFS (that is, it has
00493                                     no foreign privilege model), or foreign
00494                                     volume does not support these calls
00495     
00496     __________
00497     
00498     Also see:   FSpGetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
00499 */
00500 
00501 /*****************************************************************************/
00502 
00503 pascal  OSErr   FSpGetForeignPrivs(const FSSpec *spec,
00504                                    void *foreignPrivBuffer,
00505                                    long *foreignPrivSize,
00506                                    long *foreignPrivInfo1,
00507                                    long *foreignPrivInfo2,
00508                                    long *foreignPrivInfo3,
00509                                    long *foreignPrivInfo4);
00510 /*  ¦ Retrieve the native access-control information.
00511     The FSpGetForeignPrivs function retrieves the native access-control
00512     information for a file or directory stored on a volume managed by
00513     a foreign file system.
00514     
00515     spec                input:  An FSSpec record specifying the object.
00516     foreignPrivBuffer   input:  Pointer to buffer where the privilege
00517                                 information is returned.
00518                         output: Privilege information.
00519     foreignPrivSize     input:  Size of buffer pointed to by
00520                                 foreignPrivBuffer.
00521                         output: Amount of buffer actually used.
00522     foreignPrivInfo1    output: Information specific to privilege model.
00523     foreignPrivInfo2    output: Information specific to privilege model.
00524     foreignPrivInfo3    output: Information specific to privilege model.
00525     foreignPrivInfo4    output: Information specific to privilege model.
00526     
00527     Result Codes
00528         noErr               0       No error
00529         nsvErr              -35     Volume not found
00530         paramErr            -50     Volume is HFS or MFS (that is, it has
00531                                     no foreign privilege model), or foreign
00532                                     volume does not support these calls
00533     
00534     __________
00535     
00536     Also see:   GetForeignPrivs, SetForeignPrivs, FSpSetForeignPrivs
00537 */
00538 
00539 /*****************************************************************************/
00540 
00541 pascal  OSErr   SetForeignPrivs(short vRefNum,
00542                                 long dirID,
00543                                 ConstStr255Param name,
00544                                 const void *foreignPrivBuffer,
00545                                 long *foreignPrivSize,
00546                                 long foreignPrivInfo1,
00547                                 long foreignPrivInfo2,
00548                                 long foreignPrivInfo3,
00549                                 long foreignPrivInfo4);
00550 /*  ¦ Change the native access-control information.
00551     The SetForeignPrivs function changes the native access-control
00552     information for a file or directory stored on a volume managed by
00553     a foreign file system.
00554     
00555     vRefNum             input:  Volume specification.
00556     dirID               input:  Directory ID.
00557     name                input:  Pointer to object name, or nil when dirID
00558                                 specifies a directory that's the object.
00559     foreignPrivBuffer   input:  Pointer to privilege information buffer.
00560     foreignPrivSize     input:  Size of buffer pointed to by
00561                                 foreignPrivBuffer.
00562                         output: Amount of buffer actually used.
00563     foreignPrivInfo1    input:  Information specific to privilege model.
00564     foreignPrivInfo2    input:  Information specific to privilege model.
00565     foreignPrivInfo3    input:  Information specific to privilege model.
00566     foreignPrivInfo4    input:  Information specific to privilege model.
00567     
00568     Result Codes
00569         noErr               0       No error
00570         nsvErr              -35     Volume not found
00571         paramErr            -50     Volume is HFS or MFS (that is, it has
00572                                     no foreign privilege model), or foreign
00573                                     volume does not support these calls
00574     
00575     __________
00576     
00577     Also see:   GetForeignPrivs, FSpGetForeignPrivs, FSpSetForeignPrivs
00578 */
00579 
00580 /*****************************************************************************/
00581 
00582 pascal  OSErr   FSpSetForeignPrivs(const FSSpec *spec,
00583                                    const void *foreignPrivBuffer,
00584                                    long *foreignPrivSize,
00585                                    long foreignPrivInfo1,
00586                                    long foreignPrivInfo2,
00587                                    long foreignPrivInfo3,
00588                                    long foreignPrivInfo4);
00589 /*  ¦ Change the native access-control information.
00590     The FSpSetForeignPrivs function changes the native access-control
00591     information for a file or directory stored on a volume managed by
00592     a foreign file system.
00593     
00594     spec                input:  An FSSpec record specifying the object.
00595     foreignPrivBuffer   input:  Pointer to privilege information buffer.
00596     foreignPrivSize     input:  Size of buffer pointed to by
00597                                 foreignPrivBuffer.
00598                         output: Amount of buffer actually used.
00599     foreignPrivInfo1    input:  Information specific to privilege model.
00600     foreignPrivInfo2    input:  Information specific to privilege model.
00601     foreignPrivInfo3    input:  Information specific to privilege model.
00602     foreignPrivInfo4    input:  Information specific to privilege model.
00603     
00604     Result Codes
00605         noErr               0       No error
00606         nsvErr              -35     Volume not found
00607         paramErr            -50     Volume is HFS or MFS (that is, it has
00608                                     no foreign privilege model), or foreign
00609                                     volume does not support these calls
00610     
00611     __________
00612     
00613     Also see:   GetForeignPrivs, FSpGetForeignPrivs, SetForeignPrivs
00614 */
00615 
00616 /*****************************************************************************/
00617 
00618 pascal  OSErr   HGetLogInInfo(ConstStr255Param volName,
00619                               short vRefNum,
00620                               short *loginMethod,
00621                               StringPtr userName);
00622 /*  ¦ Get the login method and user name used to log on to a shared volume.
00623     The HGetLogInInfo function retrieves the login method and user name
00624     used to log on to a particular shared volume.
00625     
00626     volName     input:  A pointer to the name of a mounted volume
00627                         or nil.
00628     vRefNum     input:  The volume reference number.
00629     loginMethod output: The login method used (kNoUserAuthentication,
00630                         kPassword, kEncryptPassword, or
00631                         kTwoWayEncryptPassword).
00632     userName    input:  Points to a buffer (minimum Str31) where the user
00633                         name is to be returned or must be nil.
00634                 output: The user name.
00635     
00636     Result Codes
00637         noErr               0       No error
00638         nsvErr              -35     Specified volume doesnŐt exist
00639         paramErr            -50     Function not supported by volume
00640     
00641     __________
00642     
00643     Also see:   HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
00644                 FSpSetDirAccess, HMapName, HMapID
00645 */
00646 
00647 /*****************************************************************************/
00648 
00649 pascal  OSErr   HGetDirAccess(short vRefNum,
00650                               long dirID,
00651                               ConstStr255Param name,
00652                               long *ownerID,
00653                               long *groupID,
00654                               long *accessRights);
00655 /*  ¦ Get a directory's access control information on a shared volume.
00656     The HGetDirAccess function retrieves the directory access control
00657     information for a directory on a shared volume.
00658     
00659     vRefNum         input:  Volume specification.
00660     dirID           input:  Directory ID.
00661     name            input:  Pointer to directory name, or nil if dirID
00662                             specifies the directory.
00663     ownerID         output: The directory's owner ID.
00664     groupID         output: The directory's group ID or
00665                             0 if no group affiliation.
00666     accessRights    output: The directory's access rights.
00667     
00668     Result Codes
00669         noErr               0       No error
00670         fnfErr              -43     Directory not found
00671         paramErr            -50     Function not supported by volume
00672         afpAccessDenied     -5000   User does not have the correct access
00673                                     to the directory
00674     
00675     __________
00676     
00677     Also see:   HGetLogInInfo, FSpGetDirAccess, HSetDirAccess,
00678                 FSpSetDirAccess, HMapName, HMapID
00679 */
00680 
00681 /*****************************************************************************/
00682 
00683 pascal  OSErr   FSpGetDirAccess(const FSSpec *spec,
00684                                 long *ownerID,
00685                                 long *groupID,
00686                                 long *accessRights);
00687 /*  ¦ Get a directory's access control information on a shared volume.
00688     The FSpGetDirAccess function retrieves the directory access control
00689     information for a directory on a shared volume.
00690     
00691     spec            input:  An FSSpec record specifying the directory.
00692     ownerID         output: The directory's owner ID.
00693     groupID         output: The directory's group ID or
00694                             0 if no group affiliation.
00695     accessRights    output: The directory's access rights.
00696     
00697     Result Codes
00698         noErr               0       No error
00699         fnfErr              -43     Directory not found
00700         paramErr            -50     Function not supported by volume
00701         afpAccessDenied     -5000   User does not have the correct access
00702                                     to the directory
00703     
00704     __________
00705     
00706     Also see:   HGetLogInInfo, HGetDirAccess, HSetDirAccess,
00707                 FSpSetDirAccess, HMapName, HMapID
00708 */
00709 
00710 /*****************************************************************************/
00711 
00712 pascal  OSErr   HSetDirAccess(short vRefNum,
00713                               long dirID,
00714                               ConstStr255Param name,
00715                               long ownerID,
00716                               long groupID,
00717                               long accessRights);
00718 /*  ¦ Set a directory's access control information on a shared volume.
00719     The HSetDirAccess function changes the directory access control
00720     information for a directory on a shared volume. You must own a directory
00721     to change its access control information.
00722     
00723     vRefNum         input:  Volume specification.
00724     dirID           input:  Directory ID.
00725     name            input:  Pointer to directory name, or nil if dirID
00726                             specifies the directory.
00727     ownerID         input:  The directory's owner ID.
00728     groupID         input:  The directory's group ID or
00729                             0 if no group affiliation.
00730     accessRights    input:  The directory's access rights.
00731     
00732     Result Codes
00733         noErr               0       No error
00734         fnfErr              -43     Directory not found
00735         vLckdErr            -46     Volume is locked or read-only
00736         paramErr            -50     Parameter error
00737         afpAccessDenied     -5000   User does not have the correct access
00738                                     to the directory
00739         afpObjectTypeErr    -5025   Object is a file, not a directory
00740     
00741     __________
00742     
00743     Also see:   HGetLogInInfo, HGetDirAccess, FSpGetDirAccess,
00744                 FSpSetDirAccess, HMapName, HMapID
00745 */
00746 
00747 /*****************************************************************************/
00748 
00749 pascal  OSErr   FSpSetDirAccess(const FSSpec *spec,
00750                                 long ownerID,
00751                                 long groupID,
00752                                 long accessRights);
00753 /*  ¦ Set a directory's access control information on a shared volume.
00754     The FSpSetDirAccess function changes the directory access control
00755     information for a directory on a shared volume. You must own a directory
00756     to change its access control information.
00757     
00758     spec            input:  An FSSpec record specifying the directory.
00759     ownerID         input:  The directory's owner ID.
00760     groupID         input:  The directory's group ID or
00761                             0 if no group affiliation.
00762     accessRights    input:  The directory's access rights.
00763     
00764     Result Codes
00765         noErr               0       No error
00766         fnfErr              -43     Directory not found
00767         vLckdErr            -46     Volume is locked or read-only
00768         paramErr            -50     Parameter error
00769         afpAccessDenied     -5000   User does not have the correct access
00770                                     to the directory
00771         afpObjectTypeErr    -5025   Object is a file, not a directory
00772     
00773     __________
00774     
00775     Also see:   HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
00776                 HMapName, HMapID
00777 */
00778 
00779 /*****************************************************************************/
00780 
00781 pascal  OSErr   HMapID(ConstStr255Param volName,
00782                        short vRefNum,
00783                        long ugID,
00784                        short objType,
00785                        StringPtr name);
00786 /*  ¦ Map a user or group ID to a user or group name.
00787     The HMapID function determines the name of a user or group if you know
00788     the user or group ID.
00789     
00790     volName     input:  A pointer to the name of a mounted volume
00791                         or nil.
00792     vRefNum     input:  Volume specification.
00793     objType     input:  The mapping function code: 1 if you're mapping a
00794                         user ID to a user name or 2 if you're mapping a
00795                         group ID to a group name.
00796     name        input:  Points to a buffer (minimum Str31) where the user
00797                         or group name is to be returned or must be nil.
00798                 output: The user or group name.
00799     
00800     Result Codes
00801         noErr               0       No error
00802         fnfErr              -43     Unrecognizable owner or group name
00803         paramErr            -50     Function not supported by volume
00804     
00805     __________
00806     
00807     Also see:   HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
00808                 FSpSetDirAccess, HMapName
00809 */
00810 
00811 /*****************************************************************************/
00812 
00813 pascal  OSErr   HMapName(ConstStr255Param volName,
00814                          short vRefNum,
00815                          ConstStr255Param name,
00816                          short objType,
00817                          long *ugID);
00818 /*  ¦ Map a user or group name to a user or group ID.
00819     The HMapName function determines the user or group ID if you know the
00820     user or group name.
00821     
00822     volName     input:  A pointer to the name of a mounted volume
00823                         or nil.
00824     vRefNum     input:  Volume specification.
00825     name        input:  The user or group name.
00826     objType     input:  The mapping function code: 3 if you're mapping a
00827                         user name to a user ID or 4 if you're mapping a
00828                         group name to a group ID.
00829     ugID        output: The user or group ID.
00830 
00831     Result Codes
00832         noErr               0       No error
00833         fnfErr              -43     Unrecognizable owner or group name
00834         paramErr            -50     Function not supported by volume
00835     
00836     __________
00837     
00838     Also see:   HGetLogInInfo, HGetDirAccess, FSpGetDirAccess, HSetDirAccess,
00839                 FSpSetDirAccess, HMapID
00840 */
00841 
00842 /*****************************************************************************/
00843 
00844 pascal  OSErr   HCopyFile(short srcVRefNum,
00845                           long srcDirID,
00846                           ConstStr255Param srcName,
00847                           short dstVRefNum,
00848                           long dstDirID,
00849                           ConstStr255Param dstPathname,
00850                           ConstStr255Param copyName);
00851 /*  ¦ Duplicate a file on a file server and optionally to rename it.
00852     The HCopyFile function duplicates a file and optionally to renames it.
00853     The source and destination volumes must be on the same file server.
00854     This function instructs the server to copy the file.
00855     
00856     srcVRefNum  input:  Source volume specification.
00857     srcDirID    input:  Source directory ID.
00858     srcName     input:  Source file name.
00859     dstVRefNum  input:  Destination volume specification.
00860     dstDirID    input:  Destination directory ID.
00861     dstPathname input:  Pointer to destination directory name, or
00862                         nil when dstDirID specifies a directory.
00863     copyName    input:  Points to the new file name if the file is to be
00864                         renamed or nil if the file isn't to be renamed.
00865     
00866     Result Codes
00867         noErr               0       No error
00868         dskFulErr           -34     Destination volume is full
00869         fnfErr              -43     Source file not found, or destination
00870                                     directory does not exist
00871         vLckdErr            -46     Destination volume is read-only
00872         fBsyErr             -47     The source or destination file could
00873                                     not be opened with the correct access
00874                                     modes
00875         dupFNErr            -48     Destination file already exists
00876         paramErr            -50     Function not supported by volume
00877         wrgVolTypErr        -123    Function not supported by volume
00878         afpAccessDenied     -5000   The user does not have the right to
00879                                     read the source or write to the
00880                                     destination
00881         afpDenyConflict     -5006   The source or destination file could
00882                                     not be opened with the correct access
00883                                     modes
00884         afpObjectTypeErr    -5025   Source is a directory
00885     
00886     __________
00887     
00888     Also see:   FSpCopyFile, FileCopy, FSpFileCopy
00889 */
00890 
00891 /*****************************************************************************/
00892 
00893 pascal  OSErr   FSpCopyFile(const FSSpec *srcSpec,
00894                             const FSSpec *dstSpec,
00895                             ConstStr255Param copyName);
00896 /*  ¦ Duplicate a file on a file server and optionally to rename it.
00897     The FSpCopyFile function duplicates a file and optionally to renames it.
00898     The source and destination volumes must be on the same file server.
00899     This function instructs the server to copy the file.
00900     
00901     srcSpec     input:  An FSSpec record specifying the source file.
00902     dstSpec     input:  An FSSpec record specifying the destination
00903                         directory.
00904     copyName    input:  Points to the new file name if the file is to be
00905                         renamed or nil if the file isn't to be renamed.
00906     
00907     Result Codes
00908         noErr               0       No error
00909         dskFulErr           -34     Destination volume is full
00910         fnfErr              -43     Source file not found, or destination
00911                                     directory does not exist
00912         vLckdErr            -46     Destination volume is read-only
00913         fBsyErr             -47     The source or destination file could
00914                                     not be opened with the correct access
00915                                     modes
00916         dupFNErr            -48     Destination file already exists
00917         paramErr            -50     Function not supported by volume
00918         wrgVolTypErr        -123    Function not supported by volume
00919         afpAccessDenied     -5000   The user does not have the right to
00920                                     read the source or write to the
00921                                     destination
00922         afpDenyConflict     -5006   The source or destination file could
00923                                     not be opened with the correct access
00924                                     modes
00925         afpObjectTypeErr    -5025   Source is a directory
00926     
00927     __________
00928     
00929     Also see:   HCopyFile, FileCopy, FSpFileCopy
00930 */
00931 
00932 /*****************************************************************************/
00933 
00934 pascal  OSErr   HMoveRename(short vRefNum,
00935                             long srcDirID,
00936                             ConstStr255Param srcName,
00937                             long dstDirID,
00938                             ConstStr255Param dstpathName,
00939                             ConstStr255Param copyName);
00940 /*  ¦ Move a file or directory on a file server and optionally to rename it.
00941     The HMoveRename function moves a file or directory and optionally
00942     renames it. The source and destination locations must be on the same
00943     shared volume.
00944     
00945     vRefNum     input:  Volume specification.
00946     srcDirID    input:  Source directory ID.
00947     srcName     input:  The source object name.
00948     dstDirID    input:  Destination directory ID.
00949     dstName     input:  Pointer to destination directory name, or
00950                         nil when dstDirID specifies a directory.
00951     copyName    input:  Points to the new name if the object is to be
00952                         renamed or nil if the object isn't to be renamed.
00953     
00954     Result Codes
00955         noErr               0       No error
00956         fnfErr              -43     Source file or directory not found
00957         fLckdErr            -45     File is locked
00958         vLckdErr            -46     Destination volume is read-only
00959         dupFNErr            -48     Destination already exists
00960         paramErr            -50     Function not supported by volume
00961         badMovErr           -122    Attempted to move directory into
00962                                     offspring
00963         afpAccessDenied     -5000   The user does not have the right to
00964                                     move the file  or directory
00965     
00966     __________
00967     
00968     Also see:   FSpMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
00969 */
00970 
00971 /*****************************************************************************/
00972 
00973 pascal  OSErr   FSpMoveRename(const FSSpec *srcSpec,
00974                               const FSSpec *dstSpec,
00975                               ConstStr255Param copyName);
00976 /*  ¦ Move a file or directory on a file server and optionally to rename it.
00977     The FSpMoveRename function moves a file or directory and optionally
00978     renames it. The source and destination locations must be on the same
00979     shared volume.
00980     
00981     srcSpec     input:  An FSSpec record specifying the source object.
00982     dstSpec     input:  An FSSpec record specifying the destination
00983                         directory.
00984     copyName    input:  Points to the new name if the object is to be
00985                         renamed or nil if the object isn't to be renamed.
00986     
00987     Result Codes
00988         noErr               0       No error
00989         fnfErr              -43     Source file or directory not found
00990         fLckdErr            -45     File is locked
00991         vLckdErr            -46     Destination volume is read-only
00992         dupFNErr            -48     Destination already exists
00993         paramErr            -50     Function not supported by volume
00994         badMovErr           -122    Attempted to move directory into
00995                                     offspring
00996         afpAccessDenied     -5000   The user does not have the right to
00997                                     move the file  or directory
00998     
00999     __________
01000     
01001     Also see:   HMoveRename, HMoveRenameCompat, FSpMoveRenameCompat
01002 */
01003 
01004 /*****************************************************************************/
01005 
01006 pascal  OSErr   GetVolMountInfoSize(ConstStr255Param volName,
01007                                     short vRefNum,
01008                                     short *size);
01009 /*  ¦ Get the size of a volume mounting information record.
01010     The GetVolMountInfoSize function determines the how much space the
01011     program needs to allocate for a volume mounting information record.
01012     
01013     volName     input:  A pointer to the name of a mounted volume
01014                         or nil.
01015     vRefNum     input:  Volume specification.
01016     size        output: The space needed (in bytes) of the volume mounting
01017                         information record.
01018     
01019     Result Codes
01020         noErr               0       No error
01021         nsvErr              -35     Volume not found
01022         paramErr            -50     Parameter error
01023         extFSErr            -58     External file system error - no file
01024                                     system claimed this call.
01025 
01026     __________
01027     
01028     Also see:   GetVolMountInfo, VolumeMount BuildAFPVolMountInfo,
01029                 RetrieveAFPVolMountInfo
01030 */
01031 
01032 /*****************************************************************************/
01033 
01034 pascal  OSErr   GetVolMountInfo(ConstStr255Param volName,
01035                                 short vRefNum,
01036                                 void *volMountInfo);
01037 /*  ¦ Retrieve a volume mounting information record.
01038     The GetVolMountInfo function retrieves a volume mounting information
01039     record containing all the information needed to mount the volume,
01040     except for passwords.
01041     
01042     volName         input:  A pointer to the name of a mounted volume
01043                             or nil.
01044     vRefNum         input:  Volume specification.
01045     volMountInfo    output: Points to a volume mounting information
01046                             record where the mounting information is to
01047                             be returned.
01048     
01049     Result Codes
01050         noErr               0       No error    
01051         nsvErr              -35     Volume not found    
01052         paramErr            -50     Parameter error 
01053         extFSErr            -58     External file system error - no file
01054                                     system claimed this call.
01055 
01056     __________
01057     
01058     Also see:   GetVolMountInfoSize, VolumeMount, BuildAFPVolMountInfo,
01059                 RetrieveAFPVolMountInfo
01060 */
01061 
01062 /*****************************************************************************/
01063 
01064 pascal  OSErr   VolumeMount(const void *volMountInfo,
01065                             short *vRefNum);
01066 /*  ¦ Mount a volume using a volume mounting information record.
01067     The VolumeMount function mounts a volume using a volume mounting
01068     information record.
01069     
01070     volMountInfo    input:  Points to a volume mounting information record.
01071     vRefNum         output: A volume reference number.
01072     
01073     Result Codes
01074         noErr               0       No error
01075         notOpenErr          -28     AppleTalk is not open
01076         nsvErr              -35     Volume not found
01077         paramErr            -50     Parameter error; typically, zone, server,
01078                                     and volume name combination is not valid
01079                                     or not complete, or the user name is not
01080                                     recognized
01081         extFSErr            -58     External file system error - no file
01082                                     system claimed this call.
01083         memFullErr          -108    Not enough memory to create a new volume
01084                                     control block for mounting the volume
01085         afpBadUAM           -5002   User authentication method is unknown
01086         afpBadVersNum       -5003   Workstation is using an AFP version that
01087                                     the server doesnŐt recognize
01088         afpNoServer         -5016   Server is not responding
01089         afpUserNotAuth      -5023   User authentication failed (usually,
01090                                     password  is not correct)
01091         afpPwdExpired       -5042   Password has expired on server
01092         afpBadDirIDType     -5060   Not a fixed directory ID volume
01093         afpCantMountMoreSrvrs -5061 Maximum number of volumes has been
01094                                     mounted
01095         afpAlreadyMounted   -5062   Volume already mounted
01096         afpSameNodeErr      -5063   Attempt to log on to a server running
01097                                     on the same machine
01098 
01099     __________
01100     
01101     Also see:   GetVolMountInfoSize, GetVolMountInfo, BuildAFPVolMountInfo,
01102                 RetrieveAFPVolMountInfo
01103 */
01104 
01105 /*****************************************************************************/
01106 
01107 pascal  OSErr   Share(short vRefNum,
01108                       long dirID,
01109                       ConstStr255Param name);
01110 /*  ¦ Establish a local volume or directory as a share point.
01111     The Share function establishes a local volume or directory as a
01112     share point.
01113 
01114     vRefNum         input:  Volume specification.
01115     dirID           input:  Directory ID.
01116     name            input:  Pointer to directory name, or nil if dirID
01117                             specifies the directory.
01118     
01119     Result Codes
01120         noErr               0       No error    
01121         tmfoErr             -42     Too many share points   
01122         fnfErr              -43     File not found  
01123         dupFNErr            -48     Already a share point with this name    
01124         paramErr            -50     Function not supported by volume    
01125         dirNFErrdirNFErr    -120    Directory not found 
01126         afpAccessDenied     -5000   This directory cannot be shared 
01127         afpObjectTypeErr    -5025   Object was a file, not a directory  
01128         afpContainsSharedErr -5033  The directory contains a share point    
01129         afpInsideSharedErr  -5043   The directory is inside a shared directory  
01130 
01131     __________
01132     
01133     Also see:   FSpShare, Unshare, FSpUnshare
01134 */
01135 
01136 /*****************************************************************************/
01137 
01138 pascal  OSErr   FSpShare(const FSSpec *spec);
01139 /*  ¦ Establish a local volume or directory as a share point.
01140     The FSpShare function establishes a local volume or directory as a
01141     share point.
01142 
01143     spec    input:  An FSSpec record specifying the share point.
01144     
01145     Result Codes
01146         noErr               0       No error    
01147         tmfoErr             -42     Too many share points   
01148         fnfErr              -43     File not found  
01149         dupFNErr            -48     Already a share point with this name    
01150         paramErr            -50     Function not supported by volume    
01151         dirNFErrdirNFErr    -120    Directory not found 
01152         afpAccessDenied     -5000   This directory cannot be shared 
01153         afpObjectTypeErr    -5025   Object was a file, not a directory  
01154         afpContainsSharedErr -5033  The directory contains a share point    
01155         afpInsideSharedErr  -5043   The directory is inside a shared directory  
01156 
01157     __________
01158     
01159     Also see:   Share, Unshare, FSpUnshare
01160 */
01161 
01162 /*****************************************************************************/
01163 
01164 pascal  OSErr   Unshare(short vRefNum,
01165                         long dirID,
01166                         ConstStr255Param name);
01167 /*  ¦ Remove a share point.
01168     The Unshare function removes a share point.
01169 
01170     vRefNum         input:  Volume specification.
01171     dirID           input:  Directory ID.
01172     name            input:  Pointer to directory name, or nil if dirID
01173                             specifies the directory.
01174     
01175     Result Codes
01176         noErr               0       No error    
01177         fnfErr              -43     File not found  
01178         paramErr            -50     Function not supported by volume    
01179         dirNFErrdirNFErr    -120    Directory not found 
01180         afpObjectTypeErr    -5025   Object was a file, not a directory; or,
01181                                     this directory is not a share point 
01182 
01183     __________
01184     
01185     Also see:   Share, FSpShare, FSpUnshare
01186 */
01187 
01188 /*****************************************************************************/
01189 
01190 pascal  OSErr   FSpUnshare(const FSSpec *spec);
01191 /*  ¦ Remove a share point.
01192     The FSpUnshare function removes a share point.
01193 
01194     spec    input:  An FSSpec record specifying the share point.
01195     
01196     Result Codes
01197         noErr               0       No error    
01198         fnfErr              -43     File not found  
01199         paramErr            -50     Function not supported by volume    
01200         dirNFErrdirNFErr    -120    Directory not found 
01201         afpObjectTypeErr    -5025   Object was a file, not a directory; or,
01202                                     this directory is not a share point 
01203 
01204     __________
01205     
01206     Also see:   Share, FSpShare, Unshare
01207 */
01208 
01209 /*****************************************************************************/
01210 
01211 pascal  OSErr   GetUGEntry(short objType,
01212                            StringPtr objName,
01213                            long *objID);
01214 /*  ¦ Retrieve a user or group entry from the local file server.
01215     The GetUGEntry function retrieves user or group entries from the
01216     local file server.
01217 
01218     objType     input:  The object type: -1 = group; 0 = user
01219     objName     input:  Points to a buffer (minimum Str31) where the user
01220                         or group name is to be returned or must be nil.
01221                 output: The user or group name.
01222     objID       input:  O to get the first user or group. If the entry objID
01223                         last returned by GetUGEntry is passed, then user or
01224                         group whose alphabetically next in the list of entries
01225                         is returned.
01226                 output: The user or group ID.
01227     
01228     Result Codes
01229         noErr               0       No error    
01230         fnfErr              -43     No more users or groups 
01231         paramErr            -50     Function not supported; or, ioObjID is
01232                                     negative    
01233 
01234     __________
01235     
01236     Also see:   GetUGEntries
01237 */
01238 
01239 /*****************************************************************************/
01240 
01241 #ifdef __cplusplus
01242 }
01243 #endif
01244 
01245 #include "OptimizationEnd.h"
01246 
01247 #endif  /* __MOREFILES__ */

Generated on Wed May 31 18:19:55 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6