Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rtl8187

macrumors newbie
Original poster
Aug 7, 2010
1
0
I'm writing a desktop app where a temporary file
needs to be securely erased as I want to be as
responsible as possible with the users' data.

I'd like to overwrite the file with 0s and 1s and
then delete it.

I don't know a lot about HFS+. Is there code out
there that I can use that somebody can
recommend?

Thanks!
 
Just overwrite the file, then delete it. You can use any file-access functions that operate directly on files, such as the stdio functions: fopen(), fseek(), fwrite(), etc.

Functions NOT to use would be ones like the NSData methods that write an NSData to a file. Those do NOT provide direct access to a file, and if the atomic option is used, don't even write to the same file.

HFS has essentially nothing to do with it. Besides, you can't rely on the disk being HFS, so even if HFS were relevant, you can't count on it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.