diff --git a/Sources/TAR/TarWriter.swift b/Sources/TAR/TarWriter.swift index 5cde70c9..ed6ded1a 100644 --- a/Sources/TAR/TarWriter.swift +++ b/Sources/TAR/TarWriter.swift @@ -13,7 +13,7 @@ public struct TarWriter { private var longLinkNameCounter: UInt private var localPaxHeaderCounter: UInt - public init(fileHandle: FileHandle, format: TarContainer.Format = .pax) { + public init(fileHandle: FileHandle, force format: TarContainer.Format = .pax) { self.handle = fileHandle self.format = format self.longNameCounter = 0 diff --git a/Sources/swcomp/Containers/TarCommand.swift b/Sources/swcomp/Containers/TarCommand.swift index 4ccbe93e..594def5d 100644 --- a/Sources/swcomp/Containers/TarCommand.swift +++ b/Sources/swcomp/Containers/TarCommand.swift @@ -210,7 +210,7 @@ class TarCommand: Command { let outputURL = URL(fileURLWithPath: self.input) try "".write(to: outputURL, atomically: true, encoding: .utf8) let handle = try FileHandle(forWritingTo: outputURL) - var writer = TarWriter(fileHandle: handle, format: self.useFormat ?? .pax) + var writer = TarWriter(fileHandle: handle, force: self.useFormat ?? .pax) try TarEntry.generateEntries(&writer, inputPath, verbose) try writer.finalize() try handle.closeHandleCompat() diff --git a/Tests/TarWriterTests.swift b/Tests/TarWriterTests.swift index 27d6d291..f4dc5dea 100644 --- a/Tests/TarWriterTests.swift +++ b/Tests/TarWriterTests.swift @@ -31,7 +31,7 @@ class TarWriterTests: XCTestCase { let tempFileUrl = tempDir.appendingPathComponent(UUID().uuidString, isDirectory: false) try "".write(to: tempFileUrl, atomically: true, encoding: .utf8) let handle = try FileHandle(forWritingTo: tempFileUrl) - var writer = TarWriter(fileHandle: handle, format: format) + var writer = TarWriter(fileHandle: handle, force: format) for entry in entries { try writer.append(entry) }