Skip to content

Creating Visual FoxPro files results in an incorrect Header LengthΒ #117

@d4mation

Description

@d4mation

I've noticed that if a Visual FoxPro DBase file (TableType::VISUAL_FOXPRO) already exists, you can open and modify it just fine. This is because its Header Length is already defined.

However, if you're creating one from scratch, it has to generate the Header and this fails. This is because there is no Specification defined for Visual FoxPro so it falls back to the default. Edit: Actually, the issue is TableCreator::prepare_header() in this case. See my next comment.

$spec = new Specification();
switch ($version) {
case TableType::DBASE_7_MEMO:
case TableType::DBASE_7_NOMEMO:
$spec->headerTopLength = 68; // 32 + [Language driver name](32) + [Reserved](4) +
$spec->fieldLength = 48;
break;
}

This results in a non-integer value from VisualFoxproHeaderReader::getLogicalFieldCount() which throws an exception.

I've been trying to determine how to get the necessary values for a valid Specification without success. Is there any documentation out there regarding how to get this information? I've been unable to find anything myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions