writing-isam-files

Writes, updates, and deletes records in Divalto ISAM binary files via DhxIsam64.dll.

6|Updated May 11, 2026
One-click install
npx skills add https://github.com/divalto/divalto-ia-devkit --skill writing-isam-files-divalto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-isam-files
Source: https://github.com/divalto/divalto-ia-devkit/tree/main/plugins/divalto-devkit/skills/writing-isam-files
Command: npx skills add https://github.com/divalto/divalto-ia-devkit --skill writing-isam-files-divalto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Divalto ERP stores data in proprietary binary ISAM files (.dhfi) that cannot be edited directly without risking silent corruption. This Skill provides a safe, validated path to insert, update, and delete records through the official DhxIsam64.dll API, with an anti-corruption guardrail that verifies record sizes against the real dictionary before any write. ## Core Features & Use Cases - Insert, update, and delete operations: Single-record and batch writes via write_isam.py, with exact key verification before any update or delete to prevent overwriting neighboring records. - Anti-corruption guardrail: Automatically cross-checks the declared JSON structure (Dictionnaire/Base/Table/TailleEnreg) against the real .dhsd dictionary and refuses mismatched writes (error_code -2). - Structure validation and dry run: validate_structure.py checks field offsets and sizes, and --dry-run validates JSON payloads on machines without the DLL installed. - Use Case: Register a new zoom in the ERP by writing an M4 record into a5f.dhfi (Ce=4, ZoomNum, Lib, ZoomEnr, ZoomFic=ZOOMSQL), then add a corresponding M2 menu entry into g3f.dhfi using the pre-built structures. ## Quick Start Ask the AI to write a zoom record into a5f.dhfi with your field values, and it will prepare the data JSON, validate the structure, and run write_isam.py with the correct parameters.

Frequently Asked Questions about writing-isam-files

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a record into a Divalto ISAM .dhfi file?

Prepare a JSON data file with Fichier, Structure, and Donnees fields, then run write_isam.py with --params-file. The script builds the binary record with Windows-1252 encoding and space padding, then writes it via DhxIsam64.dll using xisam_twritelong.

How do I update or delete an existing ISAM record safely?

Pass --op update or --op delete with a Key (logical index name or DLL letter) and KeyFields in the JSON. The script positions via TDF.KEY, reads with tpreadlong mode R, verifies the record matches the key field by field, and only then rewrites or deletes it.

What happens if my structure record size does not match the real table?

The anti-corruption guardrail locates the .dhsd dictionary declared in the structure, resolves the real table size, and refuses the write with error_code -2 if TailleEnreg differs. This prevents silent corruption, since a .dhfi file can hold multiple tables with different record sizes.

Can I validate ISAM writes on a machine without Divalto installed?

Yes, use the --dry-run flag to validate the structure and data JSON without calling the DLL. You can also run validate_structure.py standalone to check field offsets, sizes, and TailleEnreg constraints before any write.

Why was my ISAM write reported successful but the record is not visible in the ERP?

The most common cause is writing to the wrong physical file path when multiple ERP versions coexist. Check the xwin7 -action synchroauto log to find the .dhfi path actually loaded by the runtime, and verify numeric key fields are right-justified with space padding.

What are the limitations of writing ISAM files while the ERP is running?

Sensitive files like g3f.dhfi and a5f.dhfi are cached by active ERP sessions, so writes can cause lock conflicts or invisible changes. Close the ERP session before writing, and obtain explicit authorization before update or delete operations on shared standard ERP files.