diff --git a/Sources/SwiftShell/Files.swift b/Sources/SwiftShell/Files.swift index 0c36e90..d14cbf5 100755 --- a/Sources/SwiftShell/Files.swift +++ b/Sources/SwiftShell/Files.swift @@ -60,7 +60,7 @@ If the file already exists and overwrite=false, the writing will begin at the en - parameter overwrite: If true, replace the file if it exists. */ -public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream { +public func open(forWriting path: URL, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> FileHandleStream { if overwrite || !Files.fileExists(atPath: path.path) { try Files.createDirectory(at: path.deletingLastPathComponent(), withIntermediateDirectories: true, attributes: nil) @@ -83,7 +83,7 @@ If the file already exists and overwrite=false, the writing will begin at the en - parameter overwrite: If true, replace the file if it exists. */ -public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> WritableStream { +public func open(forWriting path: String, overwrite: Bool = false, encoding: String.Encoding = main.encoding) throws -> FileHandleStream { let fixedpath = path.hasPrefix("~") ? NSString(string: path).expandingTildeInPath : path return try open(forWriting: URL(fileURLWithPath: fixedpath, isDirectory: false), overwrite: overwrite, encoding: encoding) } diff --git a/Sources/SwiftShell/Stream/Stream.swift b/Sources/SwiftShell/Stream/Stream.swift index 0414c83..81710e0 100644 --- a/Sources/SwiftShell/Stream/Stream.swift +++ b/Sources/SwiftShell/Stream/Stream.swift @@ -85,11 +85,6 @@ extension ReadableStream { while let text = self.readSome() { target.write(text) } } - /// Writes the text in this stream to the given WritableStream. - public func write(to target: inout WritableStream) { - while let text = self.readSome() { target.write(text) } - } - #if !(os(iOS) || os(tvOS) || os(watchOS)) public var context: Context { var context = CustomContext(main)