File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,8 @@ extension ZIPFoundationTests {
407
407
#if swift(>=4.0)
408
408
#elseif swift(>=3.0)
409
409
internal extension FileManager {
410
-
410
+
411
+ #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
411
412
@objc ( swiftCreateFileAtPath: contents: attributes: )
412
413
@discardableResult
413
414
func createFile( atPath path: String ,
@@ -419,6 +420,18 @@ internal extension FileManager {
419
420
}
420
421
return createFile ( atPath: path, contents: contents, attributes: attributes)
421
422
}
423
+ #else
424
+ @discardableResult
425
+ func createFile( atPath path: String ,
426
+ contents: Data ? = nil ,
427
+ attributes swift4Attributes: [ FileAttributeKey : Any ] ) -> Bool {
428
+ var attributes = [ String: Any] ( minimumCapacity: swift4Attributes. count)
429
+ swift4Attributes. forEach {
430
+ attributes [ $0. key. rawValue] = $0. value
431
+ }
432
+ return createFile ( atPath: path, contents: contents, attributes: attributes)
433
+ }
434
+ #endif
422
435
423
436
/**
424
437
Not Implemented in swift-corelibs-foundation for Swift 3
You can’t perform that action at this time.
0 commit comments