Not all field types in header are read with foxpro file
PeterCrea opened this issue · comments
In Table.php method readHeader(), the fieldcount is calculated by this formula: $fieldCount = floor(($this->headerLength - ($this->foxpro ? 296 : 33)) / 32);
However, I have foxpro files that do not contain the extra 'Database Container' block at the end of the header so because calculated number of fields is too low and some of the fields at the end of the list are not read.
In fact, one does not need to calculate the fieldcount at all since the field list is always terminated by a 0x0D byte. You do need to peek 1 byte ahead for every field you read to see if it's 0x0D, if not then it's part of the fieldname and you can do an fseek of -1.
@PeterCrea Can you provide the file without extra 'Database Container' block for tests please?
Fixed in 85fe93d