Created
October 24, 2024 19:23
-
-
Save delasign/66d85daa3535c59be5f6fb1c2c368ecf to your computer and use it in GitHub Desktop.
Sample Delete MacOS File functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func deleteFileAtLocation(url: URL) { | |
do { | |
try FileManager.default.removeItem(at: url) | |
debugPrint("\(DebuggingIdentifiers.actionOrEventSucceded) deleteFileAtLocation : \(url).") | |
} catch { | |
debugPrint("\(DebuggingIdentifiers.actionOrEventFailed) deleteFileAtLocation : \(error)") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment