My app creates a working file in the Application Support folder at launch, and subsequently saves that file in a user preferred folder (specified in preferences as a path). The save code is very simple:
- (void) saveFile: (NSString *) path {
NSFileManager *dm = [NSFileManager defaultManager];
NSError *error;
if ([dm copyItemAtPath:filePath toPath:path error:&error]) {
[dm removeItemAtPath:filePath error:&error];
}
}
Since the move to MacOS 13.0 Ventura, the call to copyItemAtPath has failed, generating an error that looks like is:
Error Domain=NSCocoaErrorDomain Code=4 "The file “Working 20221113075654.rtf” doesn’t exist." UserInfo={NSSourceFilePathErrorKey=/Users/jpurlia/Library/Application Support/My App/Working 20221113075654.rtf, NSUserStringVariant=(
Copy
), NSDestinationFilePath=~/Documents/My App/Saved File - 20221113075729.rtf, NSFilePath=/Users/jpurlia/Library/Application Support/APBA Baseball/Working 20221113075654.rtf, NSUnderlyingError=0x6000026ff180 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
I'm not sure what's going on here, as this code has been in place for quite some time and the working file does exist in the app's folder within the Application Support folder.
Any hints what could be happening here?
Thanks!