File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import Foundation
2323/// strings or and by eliminating wasted space in growable arrays). For
2424/// construction of byte arrays, clients should use the `WritableByteStream` class
2525/// and then convert to a `ByteString` when complete.
26- public struct ByteString : ExpressibleByArrayLiteral , Hashable {
26+ public struct ByteString : ExpressibleByArrayLiteral , Hashable , Sendable {
2727 /// The buffer contents.
2828 @usableFromInline
2929 internal var _bytes : [ UInt8 ]
Original file line number Diff line number Diff line change 11/*
22 This source file is part of the Swift.org open source project
33
4- Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
4+ Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors
55 Licensed under Apache License v2.0 with Runtime Library Exception
66
77 See http://swift.org/LICENSE.txt for license information
1010
1111import Foundation
1212
13+ #if swift(<5.6)
14+ extension FileAttributeType : UnsafeSendable { }
15+ extension Date : UnsafeSendable { }
16+ #endif
17+
1318/// File system information for a particular file.
14- public struct FileInfo : Equatable , Codable {
19+ public struct FileInfo : Equatable , Codable , Sendable {
1520
1621 /// The device number.
1722 public let device : UInt64
Original file line number Diff line number Diff line change @@ -111,9 +111,9 @@ public extension FileSystemError {
111111}
112112
113113/// Defines the file modes.
114- public enum FileMode {
114+ public enum FileMode : Sendable {
115115
116- public enum Option : Int {
116+ public enum Option : Int , Sendable {
117117 case recursive
118118 case onlyFiles
119119 }
@@ -122,17 +122,17 @@ public enum FileMode {
122122 case userWritable
123123 case executable
124124
125- internal var setMode : ( Int16 ) -> Int16 {
125+ public func setMode( _ originalMode : Int16 ) -> Int16 {
126126 switch self {
127127 case . userUnWritable:
128128 // r-x rwx rwx
129- return { $0 & 0o577 }
129+ return originalMode & 0o577
130130 case . userWritable:
131131 // -w- --- ---
132- return { $0 | 0o200 }
132+ return originalMode | 0o200
133133 case . executable:
134134 // --x --x --x
135- return { $0 | 0o111 }
135+ return originalMode | 0o111
136136 }
137137 }
138138}
You can’t perform that action at this time.
0 commit comments