in reply to Does this script securely delete data?

It doesn't appear to. The problem is that you're creating a new file with the same name as the original. So the original block of data could still be there. Open the file in '+<' mode first, seek to the beginning and then overwrite it.

...roboticus

  • Comment on Re: Does this script securely delete data?

Replies are listed 'Best First'.
Re^2: Does this script securely delete data?
by DrHyde (Prior) on Jul 16, 2007 at 09:36 UTC
    See File::Overwrite for an implementation of this. But it still suffers from all the problems already noted elsewhere in the thread. To do the job properly you'll need a filesystem-specific tool, and even then you're at the mercy of how the underlying disk decides to lay data out.