Error copying files with FileManager (CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no scheme)
问题 I'm trying to copy some (media) files from one folder to another using FileManager 's copyItem(at:path:) , but I'm getting the error: CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no scheme Error Domain=NSCocoaErrorDomain Code=262 "The file couldn’t be opened because the specified URL type isn’t supported." I'm using Xcode 9 beta and Swift 4. let fileManager = FileManager.default let allowedMediaFiles = ["mp4", "avi"] func isMediaFile(_ file: URL) -> Bool {