Skip to content

Commit e8bfe3c

Browse files
committed
update availability to 9999
1 parent 433baa1 commit e8bfe3c

File tree

6 files changed

+37
-17
lines changed

6 files changed

+37
-17
lines changed

Sources/System/FileStatus/FileFlags.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// FIXME: Document
1313
@frozen
14-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
14+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1515
public struct FileFlags: OptionSet {
1616
/// The raw C file flags.
1717
@_alwaysEmitIntoClient

Sources/System/FileStatus/FileMode/FileMode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// FIXME: Document
1515
@frozen
16-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
16+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1717
public struct FileMode: RawRepresentable {
1818
/// The raw C file mode.
1919
@_alwaysEmitIntoClient

Sources/System/FileStatus/FileMode/FileModeOther.swift

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// FIXME: Rename
1313
// FIXME: Document
1414
@frozen
15-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
16-
public struct FileModeOther: OptionSet {
15+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
16+
public struct FileModeOther: OptionSet, Hashable, Codable {
1717
/// The raw C file mode other.
1818
@_alwaysEmitIntoClient
1919
public var rawValue: CInterop.Mode
@@ -46,4 +46,24 @@ public struct FileModeOther: OptionSet {
4646
public static var saveText: FileModeOther { FileModeOther(0o1000) }
4747
}
4848

49+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
50+
extension FileModeOther
51+
: CustomStringConvertible, CustomDebugStringConvertible
52+
{
53+
/// A textual representation of the file permissions.
54+
@inline(never)
55+
public var description: String {
56+
let descriptions: [(Element, StaticString)] = [
57+
(.setUserID, ".setUserID"),
58+
(.setGroupID, ".setGroupID"),
59+
(.saveText, ".saveText")
60+
]
61+
62+
return _buildDescription(descriptions)
63+
}
64+
65+
/// A textual representation of the file permissions, suitable for debugging.
66+
public var debugDescription: String { self.description }
67+
}
68+
4969
#endif

Sources/System/FileStatus/FileMode/FileType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// FIXME: Document
1313
@frozen
14-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
14+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1515
public struct FileType: RawRepresentable {
1616
/// The raw C file type.
1717
@_alwaysEmitIntoClient

Sources/System/FileStatus/FileStatus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// FIXME: Document
1313
@frozen
14-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
14+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1515
public struct FileStatus: RawRepresentable {
1616
/// The raw C file status.
1717
@_alwaysEmitIntoClient

Sources/System/FileStatus/FileStatusOperations.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
// FIXME: this is wrong and should be done with wrapping fcntrl
1313
// FIXME: go through and figure out the right way to express `at` methods
14-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
14+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
1515
extension FileDescriptor {
1616
public struct ControlFlags {
1717
let rawValue: Int32
@@ -29,7 +29,7 @@ extension FileDescriptor {
2929
// [ ] int lstatx_np(const char *, struct stat *, filesec_t)
3030
// [ ] int fstatx_np(int, struct stat *, filesec_t)
3131

32-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
32+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
3333
extension FilePath {
3434
@_alwaysEmitIntoClient
3535
public func stat(
@@ -62,7 +62,7 @@ extension FilePath {
6262
// }
6363
}
6464

65-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
65+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
6666
extension FileDescriptor {
6767
internal func fstat(retryOnInterrupt: Bool = true) throws -> FileStatus {
6868
var result = CInterop.Stat()
@@ -92,7 +92,7 @@ extension FileDescriptor {
9292
// [ ] int chmodx_np(const char *, filesec_t)
9393
// [ ] int fchmodx_np(int, filesec_t)
9494

95-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
95+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
9696
extension FilePath {
9797
@_alwaysEmitIntoClient
9898
public func chmod(
@@ -122,7 +122,7 @@ extension FilePath {
122122
}
123123
}
124124

125-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
125+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
126126
extension FileDescriptor {
127127
internal func fchmod(permissions: FilePermissions, retryOnInterrupt: Bool = true) throws {
128128
try nothingOrErrno(retryOnInterrupt: retryOnInterrupt) {
@@ -147,7 +147,7 @@ extension FileDescriptor {
147147
// [x] int fchown(int, uid_t, gid_t)
148148
// [x] int fchownat(int, const char *, uid_t, gid_t, int)
149149

150-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
150+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
151151
extension FilePath {
152152
@_alwaysEmitIntoClient
153153
public func chown(
@@ -180,7 +180,7 @@ extension FilePath {
180180
}
181181
}
182182

183-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
183+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
184184
extension FileDescriptor {
185185
internal func fchown(userId: CInterop.UserId, groupId: CInterop.GroupId, retryOnInterrupt: Bool = true) throws {
186186
try nothingOrErrno(retryOnInterrupt: retryOnInterrupt) {
@@ -204,7 +204,7 @@ extension FileDescriptor {
204204
// [x] int fchflags(int, __uint32_t)
205205
// [x] int chflagsat(int, const char *, __uint32_t, int)
206206

207-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
207+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
208208
extension FilePath {
209209
@_alwaysEmitIntoClient
210210
public func chflags(
@@ -234,7 +234,7 @@ extension FilePath {
234234
}
235235
}
236236

237-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
237+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
238238
extension FileDescriptor {
239239
internal func fchflags(flags: FileFlags, retryOnInterrupt: Bool = true) throws {
240240
try nothingOrErrno(retryOnInterrupt: retryOnInterrupt) {
@@ -282,7 +282,7 @@ public func umask(newMask: FilePermissions) -> FilePermissions {
282282
// [ ] int mkfifox_np(const char *, filesec_t)
283283
// [ ] int mkdirx_np(const char *, filesec_t)
284284

285-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
285+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
286286
extension FilePath {
287287
@_alwaysEmitIntoClient
288288
public func mkfifo(
@@ -370,7 +370,7 @@ extension FileDescriptor {
370370
// [x] int futimens(int, const struct timespec[2])
371371
// [x] int utimensat(int, const char *, const struct timespec[2], int)
372372

373-
// @available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
373+
// @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
374374
extension FileDescriptor {
375375
@available(macOS 12, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
376376
internal func futimens(accessTime: TimeSpecification, modificationTime: TimeSpecification, retryOnInterrupt: Bool = true) throws {

0 commit comments

Comments
 (0)