File tree Expand file tree Collapse file tree 2 files changed +25
-14
lines changed Expand file tree Collapse file tree 2 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,4 @@ extension FileDescriptor {
122122 return . success( buffer. count)
123123 }
124124 }
125-
126- /// Return the current size of the file.
127- ///
128- /// - Returns: The current size of the file, in bytes.
129- @_alwaysEmitIntoClient
130- @discardableResult
131- public func fileSize(
132- retryOnInterrupt: Bool = true
133- ) throws -> Int64 {
134- let current = try seek ( offset: 0 , from: . current)
135- let size = try seek ( offset: 0 , from: . end)
136- try seek ( offset: current, from: . start)
137- return size
138- }
139125}
Original file line number Diff line number Diff line change 1+ /*
2+ This source file is part of the Swift System open source project
3+
4+ Copyright (c) 2020 Apple Inc. and the Swift System project authors
5+ Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+ See https://swift.org/LICENSE.txt for license information
8+ */
9+
10+ #if SYSTEM_PACKAGE
11+ @testable import SystemPackage
12+ #else
13+ @testable import System
14+ #endif
15+
16+ extension FileDescriptor {
17+ internal func fileSize(
18+ retryOnInterrupt: Bool = true
19+ ) throws -> Int64 {
20+ let current = try seek ( offset: 0 , from: . current)
21+ let size = try seek ( offset: 0 , from: . end)
22+ try seek ( offset: current, from: . start)
23+ return size
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments