How to get a unique temporary file path using Swift/Cocoa on OS X?
Cocoa does not seem to provide a function for this, only NSTemporaryDirectory()
which returns the path of the temporary directory. Using the BSD mktemp
function requires a mutable C-string as argument.
相关问题
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
- Get the NSRange for the visible text after scroll
- UIPanGestureRecognizer is not working in iOS 13
- What does a Firebase observer actually do?
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- Using if let syntax in switch statement
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
FileManager extension in Swift to get a temporary file URL. You can pass your own file name and extension, if needed.
Usage:
Swift3
I came here looking for something like boost::filesystem::unique_path()
So I made this extension to the URL class.
Usage: