This commit is contained in:
Max Howell
2019-01-17 17:31:29 -05:00
parent 4af0ee3983
commit cac06d89fb
3 changed files with 29 additions and 0 deletions

View File

@@ -47,7 +47,11 @@ public extension Data {
func write(to: Path, atomically: Bool = false) throws -> Path {
let opts: NSData.WritingOptions
if atomically {
#if os(macOS)
opts = .atomicWrite
#else
opts = .atomic
#endif
} else {
opts = []
}