stat temp files during config file writing to ensure the disk isn't full

Version 1.291

Feature
Finished

Each time a config file is written, it's first written to a temp file, then moved overtop of the orignal. This is prevent a wiping the original if the disk is full. DirectAdmin currently counts the number of bytes written as returned by the "fwrite" function, but this isn't reliable due to system cacheing. The more reliable method is to check the size of the temp file after fclose is called as the file should be flushed and fully on disk by then.

Interested to try DirectAdmin? Get a 30-day Free Trial!