Doesn't that effectively do:
unlink(filename)
create(filename)
write(filename, random)
?
Though something that opens the file in append mode then seeks to 0 would probably overwrite the same HDD locations.