|Powered by QM on a Rpi server|
KnowledgeBase 00060: Careful Update of Directory Files
Although modern disk storage sizes make it is much less of a problem than it used to be, running out of disk space when writing a directory file record can cause loss of data.
If there is insufficient disk space available for a directory file write operation to complete, the write terminates with an error. Although it is possible for an application to trap this by use of the ON ERROR clause, few applications do this. Where the write was updating an existing record, the original data is likely to have been lost by the partially completed write that failed.
The SAFEDIR Configuration Parameter
Setting the SAFEDIR configuration parameter causes the process of writing a directory file record to write the data to a temporary file and then, only if the write completes successfuly, the previous version of the record is removed and the new version is renamed to replace it.
What About Hashed Files?
The problem described above cannot occur with hashed files. A careful update process is used where, when replacing an existing record, the original data is not deleted until after the new data has been successfully written.