On 21/03/17 15:39, James Richters wrote:
If I then power off the test computer (not doing a correct windows shutdown, this simulates an unattended power failure) when it boots back up, my file has the correct date and time and the correct length, hovever the contents of the file is a string of $00 with no other characters, no carriage returns and no linefeeds, however the number of $00s is EXACTLY how many bytes the file should have been. It's like the file was allocated but data not actually written to disk yet... but I thought Close (file) was supposed to do that.
No, it does not do that. It flushes everything from the internal program buffers to the operating system, but the operating system will perform write-back caching. This is not specific to FPC programs, it does this almost all writes to a regular hard drive or SSD (Windows does not do it for USB sticks, afaik). Not doing so would slow down you system significantly.
Jonas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal