MoreFilesX.c revision ed0d4ccac4cbe85936511b94a907111e824fc588
/*
File: MoreFilesX.c
Contains: A collection of useful high-level File Manager routines
which use the HFS Plus APIs wherever possible.
Version: MoreFilesX 1.0.1
Copyright: � 1992-2002 by Apple Computer, Inc., all rights reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject
to these terms, Apple grants you a personal, non-exclusive license, under Apple�s
copyrights in this original Apple software (the "Apple Software"), to use,
reproduce, modify and redistribute the Apple Software, with or without
the Apple Software in its entirety and without modifications, you must retain
this notice and the following text and disclaimers in all such redistributions of
the Apple Software. Neither the name, trademarks, service marks or logos of
Apple Computer, Inc. may be used to endorse or promote products derived from the
Apple Software without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or implied,
are granted by Apple herein, including but not limited to any patent rights that
may be infringed by your derivative works or by other works in which the Apple
Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
(INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
File Ownership:
DRI: Apple Macintosh Developer Technical Support
Other Contact: For bug reports, consult the following page on
the World Wide Web:
Technology: DTS Sample Code
Writers:
(JL) Jim Luther
Change History (most recent first):
<4> 8/22/02 JL [3016251] Changed FSMoveRenameObjectUnicode to not use
the Temporary folder because it isn't available on
NFS volumes.
<3> 4/19/02 JL [2853905] Fixed #if test around header includes.
<2> 4/19/02 JL [2850624] Fixed C++ compile errors and Project Builder
warnings.
<2> 4/19/02 JL [2853901] Updated standard disclaimer.
<1> 1/25/02 JL MoreFilesX 1.0
*/
// Modified 2006-01-23 - added this comment.
#if defined(__MACH__)
#include <string.h>
#else
#include <Carbon.h>
#include <string.h>
#endif
#include "MoreFilesX.h"
/* Set BuildingMoreFilesXForMacOS9 to 1 if building for Mac OS 9 */
#ifndef BuildingMoreFilesXForMacOS9
#define BuildingMoreFilesXForMacOS9 0
#endif
/*****************************************************************************/
struct FSIterateContainerGlobals
{
void *yourDataPtr; /* a pointer to caller supplied data the filter may need to access */
Boolean containerChanged; /* temporary - set to true if the current container changed during iteration */
};
typedef struct FSIterateContainerGlobals FSIterateContainerGlobals;
struct FSDeleteContainerGlobals
{
};
typedef struct FSDeleteContainerGlobals FSDeleteContainerGlobals;
/*****************************************************************************/
static
void
static
void
static
long *startSeed,
/*****************************************************************************/
/*****************************************************************************/
void *copyBufferPtr,
{
/* check input parameters */
/* get source fork size */
/* allocate disk space for destination fork */
/* reset source fork's position to 0 */
/* reset destination fork's position to 0 */
/* If copyBufferSize is greater than 4K bytes, make it a multiple of 4k bytes */
/* This will make writes on local volumes faster */
{
}
/* copy source to destination */
{
srcResult = FSReadFork(srcRefNum, fsAtMark + noCacheMask, 0, copyBufferSize, copyBufferPtr, &readActualCount);
dstResult = FSWriteFork(dstRefNum, fsAtMark + noCacheMask, 0, readActualCount, copyBufferPtr, NULL);
}
/* make sure there were no errors at the destination */
/* make sure the error at the source was eofErr */
/* everything went as expected */
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
{
/* check parameters */
/* return number of bytes the file system returned in volParmsInfo buffer */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* get the volume refNum from the FSRef */
/* return volume refNum from catalogInfo */
return ( result );
}
/*****************************************************************************/
{
/* ask for the volume's sizes only if needed */
{
}
if ( NULL != totalBytes )
{
}
return ( result );
}
/*****************************************************************************/
{
if ( NULL != fileSystemID )
{
}
{
}
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* No volumes yet */
*numVolumes = 0;
/* Allocate a handle for the results */
/* Call FSGetVolumeInfo in loop to get all volumes starting with the first */
volumeIndex = 1;
do
{
{
/* concatenate the FSRef to the end of the handle */
++(*numVolumes); /* increment the volume count */
++volumeIndex; /* and the volumeIndex to get the next volume*/
}
/* nsvErr is OK -- it just means there are no more volumes */
return ( noErr );
/**********************/
/* dispose of handle if already allocated and clear the outputs */
if ( NULL != *volumeRefsHandle )
{
*volumeRefsHandle = NULL;
}
*numVolumes = 0;
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* convert the inputs to an FSRef */
/* and then convert the FSRef to a path */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* convert the POSIX path to an FSRef */
/* and then convert the FSRef to an FSSpec */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* make sure output is valid in case we get errors or there's nothing to convert */
hfsName[0] = 0;
if ( 0 == unicodeByteLength )
{
/* do nothing */
}
else
{
/* if textEncodingHint is kTextEncodingUnknown, get a "default" textEncodingHint */
if ( kTextEncodingUnknown == textEncodingHint )
{
NULL, &textEncodingHint );
{
/* ok, ignore the region and try again */
}
{
/* ok... try something */
}
}
/* verify the result in debug builds -- there's really not anything you can do if it fails */
}
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* make sure output is valid in case we get errors or there's nothing to convert */
unicodeName->length = 0;
{
}
else
{
/* if textEncodingHint is kTextEncodingUnknown, get a "default" textEncodingHint */
if ( kTextEncodingUnknown == textEncodingHint )
{
NULL, &textEncodingHint);
{
/* ok, ignore the region and try again */
}
{
/* ok... try something */
}
}
0, /* no control flag bits */
/* convert from byte count to char count */
/* verify the result in debug builds -- there's really not anything you can do if it fails */
}
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
{
}
/*****************************************************************************/
{
/* check parameters */
/*
* Note: FSRefs always point to real file system objects. So, there cannot
* be a FSRef to the parent of volume root directories. Early versions of
* Mac OS X do not handle this case correctly and incorrectly return a
* FSRef for the parent of volume root directories instead of returning an
* invalid FSRef (a cleared FSRef is invalid). The next three lines of code
* ensure that you won't run into this bug. WW9D!
*/
{
/* clear parentRef and return noErr which is the proper behavior */
}
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
long *nodeID, /* can be NULL */
{
/* determine what catalog information to get */
{
}
if ( NULL != isDirectory )
{
}
{
}
if ( NULL != isDirectory )
{
}
return ( result );
}
/*****************************************************************************/
{
/* determine what catalog information to get */
if ( NULL != userPrivileges )
{
}
if ( NULL != permissions )
{
}
if ( NULL != userPrivileges )
{
}
if ( NULL != permissions )
{
}
return ( result );
}
/*****************************************************************************/
{
/* get nodeFlags and vRefNum for container */
result = FSGetCatalogInfo(ref, kFSCatInfoNodeFlags + kFSCatInfoVolume, &catalogInfo, NULL, NULL,NULL);
/* is file locked? */
{
}
else
{
/* file isn't locked, but is volume locked? */
/* get volume flags */
{
}
{
}
}
return ( result );
}
/*****************************************************************************/
{
if ( NULL != dataLogicalSize )
{
/* get data fork size */
}
if ( NULL != rsrcLogicalSize )
{
/* get resource fork size */
}
/* get nodeFlags and catalog info */
/* make sure FSRef was to a file */
require_action(0 == (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask), FSRefNotFile, result = notAFileErr);
if ( NULL != dataLogicalSize )
{
/* return data fork size */
}
if ( NULL != rsrcLogicalSize )
{
/* return resource fork size */
}
return ( result );
}
/*****************************************************************************/
{
/* Determine if forkSize needed */
if ( NULL != totalLogicalSize)
{
*totalLogicalSize = 0;
forkSizePtr = &forkSize;
}
else
{
forkSizePtr = NULL;
}
/* Determine if forkPhysicalSize is needed */
if ( NULL != totalPhysicalSize )
{
*totalPhysicalSize = 0;
}
else
{
}
/* zero fork count if returning it */
{
*forkCount = 0;
}
/* Iterate through the forks to get the sizes */
forkIterator.initialize = 0;
do
{
{
if ( NULL != totalLogicalSize )
{
*totalLogicalSize += forkSize;
}
if ( NULL != totalPhysicalSize )
{
}
{
++*forkCount;
}
}
/* any error result other than errFSNoMoreItems is serious */
/* Normal exit */
return ( result );
}
/*****************************************************************************/
{
#endif
/* Get the node flags, the content modification date and time, and the parent ref */
result = FSGetCatalogInfo(ref, kFSCatInfoNodeFlags + kFSCatInfoContentMod, &catalogInfo, NULL, NULL, &parentRef);
/* Notify the parent if this is a file */
#else
/* Get the content modification date and time */
#endif
/* Get the current date and time */
/* if the old date and time is the the same as the current, bump the seconds by one */
{
{
}
}
/* Bump the content modification date and time */
/*
* The problem with FNNotify is that it is not available under Mac OS 9
* and there's no way to test for that except for looking for the symbol
* or something. So, I'll just conditionalize this for those who care
* to send a notification.
*/
/* Send a notification for the parent of the file, or for the directory */
#endif
/* ignore errors from FSSetCatalogInfo (volume might be write protected) and FNNotify */
return ( noErr );
/**********************/
return ( result );
}
/*****************************************************************************/
{
/* determine what catalog information is really needed */
{
/* get FinderInfo */
}
if ( NULL != extendedInfo )
{
/* get ExtendedFinderInfo */
}
if ( NULL != isDirectory )
{
}
/* return FinderInfo if requested */
{
}
/* return ExtendedFinderInfo if requested */
if ( NULL != extendedInfo)
{
}
/* set isDirectory Boolean if requested */
if ( NULL != isDirectory)
{
}
return ( result );
}
/*****************************************************************************/
const FinderInfo *info,
const ExtendedFinderInfo *extendedInfo)
{
/* determine what catalog information will be set */
{
/* set FinderInfo */
}
if ( NULL != extendedInfo )
{
/* set ExtendedFinderInfo */
}
return ( result );
}
/*****************************************************************************/
{
/* get nodeFlags, finder info, and parent FSRef */
result = FSGetCatalogInfo(ref, kFSCatInfoNodeFlags + kFSCatInfoFinderInfo, &catalogInfo , NULL, NULL, &parentRef);
/* make sure FSRef was to a file */
require_action(0 == (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask), FSRefNotFile, result = notAFileErr);
/* If fileType not 0x00000000, change fileType */
{
}
/* If creator not 0x00000000, change creator */
{
}
/* now, save the new information back to disk */
/* and attempt to bump the parent directory's mod date to wake up */
/* the Finder to the change we just made (ignore errors from this) */
return ( result );
}
/*****************************************************************************/
{
/* get the current finderInfo */
/* set or clear the appropriate bits in the finderInfo.finderFlags */
if ( setBits )
{
/* OR in the bits */
}
else
{
/* AND out the bits */
}
/* save the modified finderInfo */
/* and attempt to bump the parent directory's mod date to wake up the Finder */
/* to the change we just made (ignore errors from this) */
return ( result );
}
/*****************************************************************************/
{
}
{
}
/*****************************************************************************/
{
}
{
}
/*****************************************************************************/
{
}
{
}
/*****************************************************************************/
{
}
{
}
/*****************************************************************************/
{
}
/*****************************************************************************/
const FSRef *destinationRef,
{
/* get the source information */
/* don't copy the hasBeenInited bit; clear it */
/* should the locked bit be copied? */
if ( !copyLockBit )
{
/* no, make sure the locked bit is clear */
}
/* set the destination information */
return ( result );
}
/*****************************************************************************/
const FSRef *destDirectory,
{
long theSeed; /* the seed for generating unique names */
/* check parameters */
/* newRef = input to start with */
/* get destDirectory's vRefNum */
/* save vRefNum */
/* get ref's vRefNum, TextEncoding, name and parent directory*/
result = FSGetCatalogInfo(ref, kFSCatInfoTextEncoding + kFSCatInfoVolume, &catalogInfo, &originalName, NULL, &originalDirectory);
/* save TextEncoding */
/* make sure ref and destDirectory are on same volume */
/* Skip a few steps if we're not renaming */
{
/* generate a name that is unique in both directories */
/* Rename the object to uniqueName */
{
/* Move object to its new home */
}
/* Rename the object to new name */
}
else
{
/* Move object to its new home */
}
return ( result );
/*************/
/*
* failure handling code when renaming
*/
/* Error handling: move object back to original location - ignore errors */
/* Error handling: rename object back to original name - ignore errors */
verify_noerr(FSRenameUnicode(newRef, originalName.length, originalName.unicode, originalTextEncodingHint, newRef));
/*
* failure handling code for renaming or not
*/
return ( result );
}
/*****************************************************************************/
/*
The FSDeleteContainerLevel function deletes the contents of a container
directory. All files and subdirectories in the specified container are
deleted. If a locked file or directory is encountered, it is unlocked
and then deleted. If any unexpected errors are encountered,
FSDeleteContainerLevel quits and returns to the caller.
container --> FSRef to a directory.
theGlobals --> A pointer to a FSDeleteContainerGlobals struct
which contains the variables that do not need to
be allocated each time FSDeleteContainerLevel
recurses. That lets FSDeleteContainerLevel use
less stack space per recursion level.
*/
static
void
{
/* level locals */
/* Open FSIterator for flat access and give delete optimization hint */
/* delete the contents of the directory */
do
{
/* get 1 item to delete */
{
/* save node flags in local in case we have to recurse */
/* is it a file or directory? */
if ( 0 != (nodeFlags & kFSNodeIsDirectoryMask) )
{
/* it's a directory -- delete its contents before attempting to delete it */
}
/* are we still OK to delete? */
{
/* is item locked? */
if ( 0 != (nodeFlags & kFSNodeLockedMask) )
{
/* then attempt to unlock it (ignore result since FSDeleteObject will set it correctly) */
}
/* delete the item */
}
}
/* we found the end of the items normally, so return noErr */
{
}
/* close the FSIterator (closing an open iterator should never fail) */
return;
}
/*****************************************************************************/
{
/* delete container's contents */
return ( theGlobals.result );
}
/*****************************************************************************/
{
/* get nodeFlags for container */
/* make sure container is a directory */
require_action(0 != (catalogInfo.nodeFlags & kFSNodeIsDirectoryMask), ContainerNotDirectory, result = dirNFErr);
/* delete container's contents */
/* is container locked? */
{
/* then attempt to unlock container (ignore result since FSDeleteObject will set it correctly) */
}
/* delete the container */
return ( result );
}
/*****************************************************************************/
/*
The FSIterateContainerLevel function iterates the contents of a container
directory and calls a IterateContainerFilterProc function once for each
file and directory found.
theGlobals --> A pointer to a FSIterateContainerGlobals struct
which contains the variables needed globally by
all recusion levels of FSIterateContainerLevel.
That makes FSIterateContainer thread safe since
each call to it uses its own global world.
It also contains the variables that do not need
to be allocated each time FSIterateContainerLevel
recurses. That lets FSIterateContainerLevel use
less stack space per recursion level.
*/
static
void
{
/* If maxLevels is zero, we aren't checking levels */
/* If currentLevel < maxLevels, look at this level */
if ( (theGlobals->maxLevels == 0) ||
{
/* Open FSIterator for flat access to theGlobals->ref */
/* Call FSGetCatalogInfoBulk in loop to get all items in the container */
do
{
(0 != theGlobals->actualObjects) )
{
/* Call the IterateFilterProc */
/* Is it a directory? */
{
/* Keep going? */
if ( !theGlobals->quitFlag )
{
/* Dive again if the IterateFilterProc didn't say "quit" */
}
}
}
/* time to fall back a level? */
/* errFSNoMoreItems is OK - it only means we hit the end of this level */
/* afpAccessDenied is OK, too - it only means we cannot see inside a directory */
{
}
/* Close the FSIterator (closing an open iterator should never fail) */
}
return;
}
/*****************************************************************************/
void *yourDataPtr)
{
/* make sure there is an iterateFilter */
/*
* set up the globals we need to access from the recursive routine
*/
/* we need the node flags no matter what was requested so we can detect files vs. directories */
/* start with input container -- the first OpenIterator will ensure it is a directory */
if ( wantFSSpec )
{
}
else
{
}
if ( wantName )
{
}
else
{
}
theGlobals.currentLevel = 0;
theGlobals.quitFlag = false;
theGlobals.containerChanged = false;
theGlobals.actualObjects = 0;
/* here we go into recursion land... */
return ( result );
}
/*****************************************************************************/
{
/* Grab items 10 at a time. */
enum { kMaxItemsPerBulkCall = 10 };
/* check parameters */
*numRefs = 0;
*containerChanged = false;
/* open an FSIterator */
/* Call FSGetCatalogInfoBulk in loop to get all items in the container */
do
{
/* if the container changed, set containerChanged for output, but keep going */
if ( changed )
{
}
/* any result other than noErr and errFSNoMoreItems is serious */
/* add objects to output array and count */
if ( 0 != actualObjects )
{
/* concatenate the FSRefs to the end of the handle */
*numRefs += actualObjects;
}
return ( noErr );
/**********************/
/* close the iterator */
/* dispose of handle if already allocated and clear the outputs */
if ( NULL != *refsHandle )
{
*refsHandle = NULL;
}
*numRefs = 0;
return ( result );
}
/*****************************************************************************/
/*
The GenerateUniqueName function generates a HFSUniStr255 name that is
unique in both dir1 and dir2.
startSeed --> A pointer to a long which is used to generate the
unique name.
<-- It is modified on output to a value which should
be used to generate the next unique name.
dir1 --> The first directory.
dir2 --> The second directory.
uniqueName <-- A pointer to a HFSUniStr255 where the unique name
is to be returned.
*/
static
long *startSeed,
{
long i;
/* set up the parameter block */
/* loop until we get fnfErr with a filename in both directories */
{
/* convert startSeed to 8 character Unicode string */
for ( i = 0; i < 8; ++i )
{
}
/* try in dir1 */
{
/* try in dir2 */
{
/* exit if anything other than noErr or fnfErr */
}
}
else
{
/* exit if anything other than noErr or fnfErr */
}
/* increment seed for next pass through loop, */
/* or for next call to GenerateUniqueHFSUniStr */
++(*startSeed);
}
/* we have a unique file name which doesn't exist in dir1 or dir2 */
return ( result );
}
/*****************************************************************************/
{
enum
{
/* get all settable info except for mod dates, plus the volume refNum and parent directory ID */
/* set everything possible except for mod dates */
};
HFSUniStr255 sourceUniqueName; /* unique name given to source file while exchanging it with destination */
HFSUniStr255 destUniqueName; /* unique name given to destination file while exchanging it with source */
long theSeed; /* the seed for generating unique names */
/* check parameters */
/* output refs and current refs = input refs to start with */
/* get source volume's vRefNum */
result = FSGetCatalogInfo(&sourceCurrentRef, kFSCatInfoVolume, &sourceCatalogInfo, NULL, NULL, NULL);
/* see if that volume supports FSExchangeObjects */
&volParmsInfo, &infoSize);
{
/* yes - use FSExchangeObjects */
}
else
{
/* no - emulate FSExchangeObjects */
/* Note: The compatibility case won't work for files with *Btree control blocks. */
/* Right now the only *Btree files are created by the system. */
/* get all catalog information and Unicode names for each file */
result = FSGetCatalogInfo(&sourceCurrentRef, kGetCatInformationMask, &sourceCatalogInfo, &sourceName, NULL, &sourceParentRef);
result = FSGetCatalogInfo(&destCurrentRef, kGetCatInformationMask, &destCatalogInfo, &destName, NULL, &destParentRef);
/* make sure source and destination are on same volume */
require_action(sourceCatalogInfo.volume == destCatalogInfo.volume, NotSameVolume, result = diffVolErr);
/* make sure both files are *really* files */
/* generate 2 names that are unique in both directories */
/* rename sourceCurrentRef to sourceUniqueName */
result = FSRenameUnicode(&sourceCurrentRef, sourceUniqueName.length, sourceUniqueName.unicode, kTextEncodingUnknown, newSourceRef);
/* rename destCurrentRef to destUniqueName */
result = FSRenameUnicode(&destCurrentRef, destUniqueName.length, destUniqueName.unicode, kTextEncodingUnknown, newDestRef);
/* are the source and destination parent directories the same? */
if ( !sameParentDirs )
{
/* move source file to dest parent directory */
/* move dest file to source parent directory */
}
/* At this point, the files are in their new locations (if they were moved). */
/* The source file is named sourceUniqueName and is in the directory referred to */
/* by destParentRef. The destination file is named destUniqueName and is in the */
/* directory referred to by sourceParentRef. */
/* give source file the dest file's catalog information except for mod dates */
/* give dest file the source file's catalog information except for mod dates */
/* rename source file with dest file's name */
result = FSRenameUnicode(&sourceCurrentRef, destName.length, destName.unicode, destCatalogInfo.textEncodingHint, newSourceRef);
/* rename dest file with source file's name */
result = FSRenameUnicode(&destCurrentRef, sourceName.length, sourceName.unicode, sourceCatalogInfo.textEncodingHint, newDestRef);
/* we're done with no errors, so swap newSourceRef and newDestRef */
}
return ( result );
/**********************/
/* If there are any failures while emulating FSExchangeObjects, attempt to reverse any steps */
/* already taken. In any case, newSourceRef and newDestRef will refer to the files in whatever */
/* state and location they ended up in so that both files can be found by the calling code. */
/* attempt to rename source file to sourceUniqueName */
if ( noErr == FSRenameUnicode(&sourceCurrentRef, sourceUniqueName.length, sourceUniqueName.unicode, kTextEncodingUnknown, newSourceRef) )
{
}
/* attempt to restore dest file's catalog information */
/* attempt to restore source file's catalog information */
if ( !sameParentDirs )
{
/* attempt to move dest file back to dest directory */
{
}
}
if ( !sameParentDirs )
{
/* attempt to move source file back to source directory */
{
}
}
/* attempt to rename dest file to original name */
verify_noerr(FSRenameUnicode(&destCurrentRef, destName.length, destName.unicode, destCatalogInfo.textEncodingHint, newDestRef));
/* attempt to rename source file to original name */
verify_noerr(FSRenameUnicode(&sourceCurrentRef, sourceName.length, sourceName.unicode, sourceCatalogInfo.textEncodingHint, newSourceRef));
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
/* Renamed from FSLockRange to MFX_FSLockRange to avoid a conflict with
* the FSLockRange function present in the system library since Mac OS X
* 10.4. */
{
return ( result );
}
/*****************************************************************************/
/* Renamed from FSUnlockRange to MFX_FSUnlockRange to avoid a conflict with
* the FSUnlockRange function present in the system library since Mac OS X
* 10.4. */
{
return ( result );
}
/*****************************************************************************/
{
/* get FSSpec from FSRef */
/* get directory access info for FSSpec */
/* return the IDs and access rights */
{
}
{
}
if ( NULL != accessRights )
{
}
return ( result );
}
/*****************************************************************************/
{
enum
{
/* Just the bits that can be set */
};
/* get FSSpec from FSRef */
/* set directory access info for FSSpec */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
void *volMountInfo)
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
// This function exists in Mac OS X 10.5, we cannot re-define it here.
// We don't use this function, so just don't compile it.
#if 0
const void *volMountInfo,
{
/* check parameters */
/* return the volume reference number */
return ( result );
}
#endif
/*****************************************************************************/
{
/* check parameters */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* return the user or group ID */
return ( result );
}
/*****************************************************************************/
const FSRef *srcFileRef,
const FSRef *dstDirectoryRef,
{
/* get source FSSpec from source FSRef */
/* Make sure the volume supports CopyFile */
&volParmsInfo, &infoSize);
/* get destination volume reference number and destination directory ID from destination FSRef */
/* tell the server to copy the object */
{
}
else
{
}
{
}
return ( result );
}
/*****************************************************************************/
const FSRef *srcFileRef,
const FSRef *dstDirectoryRef,
{
/* get source FSSpec from source FSRef */
/* Make sure the volume supports MoveRename */
&volParmsInfo, &infoSize);
/* get destination volume reference number and destination directory ID from destination FSRef */
/* make sure the source and destination are on the same volume */
/* tell the server to move and rename the object */
{
}
else
{
}
{
}
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
{
/* check parameters */
/* resolve the file ID reference */
tempStr[0] = 0;
/* and then make an FSRef to the file */
return ( result );
}
/*****************************************************************************/
{
/* check parameters */
/* Get an FSSpec from the FSRef */
/* Create (or get) the file ID reference using the FSSpec */
/* return the file ID reference */
return ( result );
}
/*****************************************************************************/
/*****************************************************************************/
{
enum
{
};
/* check parameters */
/* Make request a multiple of 4K bytes */
if ( buffReqSize < 0x00001000 )
{
/* Request was smaller than 4K bytes - make it 4K */
buffReqSize = 0x00001000;
}
/* Attempt to allocate the memory */
/* If request failed, go to backup plan */
{
/*
** Try to get largest 4K byte block available
** leaving some slop for the toolbox if possible
*/
if ( buffReqSize > freeMemory )
{
}
if ( buffReqSize == 0 )
{
buffReqSize = 0x00001000;
}
}
/* Return bytes allocated */
{
}
else
{
*buffActSize = 0;
}
return ( tempPtr );
}
/*****************************************************************************/
short refNum,
{
}
/*****************************************************************************/
const FSRef *newDefault,
{
long dirID;
/* check parameters */
/* Get nodeFlags, vRefNum and dirID (nodeID) of newDefault */
/* Make sure newDefault is a directory */
/* Get the current working directory. */
/* Return the oldDefault FSRef */
/* Set the new current working directory */
return ( result );
}
/*****************************************************************************/
const FSRef *oldDefault)
{
/* check parameters */
/* Get nodeFlags, vRefNum and dirID (nodeID) of oldDefault */
/* Make sure oldDefault is a directory */
/* Set the current working directory to oldDefault */
return ( result );
}
/*****************************************************************************/