Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not all field types in header are read with foxpro file #69

Closed
PeterCrea opened this issue Jul 19, 2019 · 2 comments
Closed

Not all field types in header are read with foxpro file #69

PeterCrea opened this issue Jul 19, 2019 · 2 comments

Comments

@PeterCrea
Copy link

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.

@gam6itko
Copy link
Collaborator

gam6itko commented Feb 9, 2020

@PeterCrea Can you provide the file without extra 'Database Container' block for tests please?

@gam6itko
Copy link
Collaborator

Fixed in 85fe93d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants