This commit is contained in:
2023-03-14 16:23:16 -04:00
parent 37f3bfde62
commit 78bfa7863a
18 changed files with 237 additions and 217 deletions

View File

@@ -106,10 +106,20 @@ public struct FileClient {
try self.write(data, url)
}
/// Write's the given string to a file.
///
/// - Parameters:
/// - string: The string to write to the file.
/// - url: The file url.
public func write(string: String, to url: URL) throws {
try self.write(Data(string.utf8), url)
}
/// Write's the the string to a file path.
///
/// - Parameters:
/// - string: The string to write to the file.
/// - path: The file path.
public func write(string: String, to path: String) throws {
let url = try url(for: path)
try self.write(string: string, to: url)