# File inconsistency handler

The file inconsistency handler processes file inconsistencies
encountered in the D3 file system.

The file inconsistency is first logged as an event in
the errors file, residing in the dm account, after which the user
is given the option of either repairing the damage manually, or letting
the File Inconsistency handler attempt to resolve the problem by fixing
the error and logging any additional information about the file inconsistency
into dm,errors,gfe file.

The system can
be configured so that the File Inconsistency handler always performs
its repairs without requiring user intervention, by placing an m in the options field in the users file for each user that
operates in this automatic fix mode. This mode effectively allows
deferring any exception processing until someone more knowledgeable
is able to look at the data, at the same time allowing the process
that encountered the file inconsistency to resolve the structural
inconsistency of the file and continue to operate. It is also convenient
in support situations where an end user site needs to continue operating
at all costs.

Up to 2 frames of raw data in the group, starting
at the beginning of first item affected by the file inconsistency,
is copied and stored in the dm,errors,gfe file
where it can be examined using the dump utility.

For file inconsistencies that are fixed automatically by the system,
the system attempts to reconstruct and recover as much of the group
or item as possible using whatever information is deemed reliable
and available to it and truncates any remaining structures from that
point.

Warning: Depending on the nature of the file
inconsistency, DATA MAY BE CORRUPTED! Users should verify their data
for integrity and consistency after encountering a file inconsistency.
The t-verify command can be used to create a differences
report from the previous `file-save`, which can aid
in reducing the number of transactions or files that may need reviewing.

## See also

- [account-save command](https://d3codex.com/tcl/account-save-command/)
- [errors file](https://d3codex.com/systemfiles/errors-file/)
- [File inconsistency handler](https://d3codex.com/definitions/file-inconsistency-handler/)
- [File inconsistency handler](https://d3codex.com/definitions/file-inconsistency-handler/)
- [flush command](https://d3codex.com/tcl/flush-command/)
- [Modulo](https://d3codex.com/definitions/modulo-glossary/)
- [users file](https://d3codex.com/systemfiles/users-file/)

---
Source: https://d3codex.com/definitions/file-inconsistency-handler/ - part of the D3Codex reference.
