There seems to be a lot of independent investigators here looking for buggy execution of this code (which actually be caused by or worsened by a Windows, Server operating system). The main issue seems to be knowing for certain that the file was actually deleted, for example, not producing an error when a file isn't deleted on the command, or producing an error when the file actually is deleted. Anyhow, the following is a tiny piece of code that absolutely deletes, even if it produces an error message, or never finishes, if it is unable to delete.
There are two outcomes: (1) It deletes the file, and continues happily along, error message, or not. (2) It can't delete the file, can't modify the permissions, etc., and therefore, the script never completes, or it may throw some PHP errors at you eventually.
<?php
while(is_file($data_file_to_delete) == TRUE)
{
chmod($data_file_to_delete, 0666);
unlink($data_file_to_delete);
}
?>