             }
         }
 
+        var fileNameData = Data()
         if var fileName = fileName {
             flags |= 1 << 3
             if fileName.characters.last != "\u{00}" {

            flags |= 1 << 0
        }

        if let osType = osType {
            os = (osType == .other ? 255 : osType.rawValue).toUInt8()
        }

        if let modificationTime = modificationTime {
            let timeInterval = Int(modificationTime.timeIntervalSince1970)
            for i in 0..<4 {

        var flags: UInt8 = 0

        var commentData = Data()
        if var comment = comment {
            flags |= 1 << 4
            if comment.characters.last != "\u{00}" {
