I have an app (Swift) that stores image file paths in a database. At some point it needs to copy all of those images to a central location.
I have tried everything and keep getting strange errors
here is the relavant part of the code
print("SRC=\(srcURL)")
print("DST=\(dstURL)")
do {
try fileMANAGER.copyItem(at: srcURL, to: dstURL)
} catch let error as NSError { print(error)}
the output is
SRC=file:///Volumes/Drive%20#1/SWIFT-Projects/Swift_Framework2021/extractGUI/morgan.png
NEW=file:///Volumes/Drive%20%231/SWIFT-Projects/Swift_Framework2021/extractGUI/simple%20SWIFT/Assets.xcassets/morgan.imageset/morgan.png
Error Domain=NSCocoaErrorDomain Code=260 "The file “Drive ” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Volumes/Drive , NSUnderlyingError=0x600000978c90 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
both Src and Dst are URLs, but the strange thing is the error
"The file “Drive ” couldn’t be opened
uh… what happened to the rest of the path, “copyItem” is a macOS function, not something I wrote