File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,28 @@ extension NSData {
414
414
}
415
415
}
416
416
417
+ public func writeToFile( path: String , atomically useAuxiliaryFile: Bool ) -> Bool {
418
+ do {
419
+ try writeToFile ( path, options: useAuxiliaryFile ? . DataWritingAtomic : [ ] )
420
+ } catch {
421
+ return false
422
+ }
423
+ return true
424
+ }
425
+
426
+ public func writeToURL( url: NSURL , atomically: Bool ) -> Bool {
427
+ if url. fileURL {
428
+ if let path = url. path {
429
+ return writeToFile ( path, atomically: atomically)
430
+ }
431
+ }
432
+ return false
433
+ }
434
+
435
+ public func writeToURL( url: NSURL , options writeOptionsMask: NSDataWritingOptions ) throws {
436
+ NSUnimplemented ( )
437
+ }
438
+
417
439
internal func enumerateByteRangesUsingBlockRethrows( block: ( UnsafePointer < Void > , NSRange , UnsafeMutablePointer < Bool > ) throws -> Void ) throws {
418
440
var err : ErrorType ? = nil
419
441
self . enumerateByteRangesUsingBlock ( ) { ( buf, range, stop) -> Void in
You can’t perform that action at this time.
0 commit comments