|
If you picture how a file is laid out on a disk (under some operating systems), it is a chain of areas in the disk, so that start of the file is at one location, then that points to some more of the file and that points to somewhere else and so on. This is so that files don't have to all be in one contiguous block on the disk, which would be hard to manage.
When you open and truncate, there is a possibility that all of the rest of the disk space used by the file is given back to the OS immediately. The disk space might then go into the free space pool. When you write the new data into the file, the OS may not give the file the same locations as it did before, meaning that you will now be securely overwriting some other part of the disk, with the data you are trying to wipe out still being on the disk, but in a "free" area.
|