diff --git a/Sources/GzipArchive.swift b/Sources/GzipArchive.swift index c52a4d2f..8ba6c6bc 100644 --- a/Sources/GzipArchive.swift +++ b/Sources/GzipArchive.swift @@ -68,7 +68,7 @@ public struct GzipHeader { case ntfs = 11 /// File system was unknown to the archiver. case unknown = 255 - /// File system was one of the rare systems.. + /// File system was one of the rare systems. case other = 256 } @@ -83,6 +83,8 @@ public struct GzipHeader { /// Comment inside the archive. public let comment: String? + public let isTextFile: Bool + /** Initializes the structure with the values of first 'member' in gzip archive presented in `archiveData`. @@ -128,6 +130,8 @@ public struct GzipHeader { self.osType = FileSystemType(rawValue: pointerData.alignedByte().toInt()) ?? .other headerBytes.append(self.osType.rawValue.toUInt8()) + self.isTextFile = flags & Flags.ftext != 0 + // Some archives may contain extra fields if flags & Flags.fextra != 0 { let xlen = pointerData.intFromAlignedBytes(count: 2)