On Apr 24, 2011, at 1:04 PM, Warren Lanford wrote:
> I'm trying to find out how to check to see if a file is present, and if so
Use the File Directory calls ( from Util_FileDirectory.incl ) to determine the presence of a file. Either of:
toolbox fn FD_ObjectExistsFSRef( CFStringRef name, FSRef *parRef ) = Boolean
toolbox fn FD_ObjectExistsCFURL( CFURLRef url ) = Boolean
toolbox fn FD_ObjectExistsFSSpec( FSSpec *spec ) = Boolean
will work depending on what( ref, url or spec ) is being used to identify the file. The FSRef version requires the ref of the parent directory for the file. There is a demo of the url version in ( drum roll ): Examples/Files/File_Directory examples
Maybe you could describe the conditions in your app that require checking for file locking. Describe which app you think is locking a file and why. File locking, depending on overall goals, may not be the best approach.
Brian S