On 5/4/06, Dennis Cote <[EMAIL PROTECTED]> wrote:
It seems *really* strange that deleting the file would reduce the average run time of the 10000 loop case by more than 60 seconds. Neither overwriting the file or deleting the file should take anywhere near this long. These are small files of only 10K characters after all.
I think I understand that part. In one case (the deleted file) it's going to the free disk block list to allocate new chunks of disk space for the file. This is probably very quick since that's probably cached. In the other case, If the file isn't deleted it has to read the directory entry, figure out where the disk block is that represents that portion of the file, then seek to it, insert the data into the existing block image, then write.