gypsyDev
gypsyDev

Reputation: 1299

NSFilemanager and secure delete

Is there any officially supported way of secure-deleting files in Mac OS X 10.5+?

if not, what about if I move all files (using NSFilemanager) to a common folder, and use srm: from a shell script. Would this delete all traces of a file, or would the file still be recoverable because of the move operation?

thanks in advance for any help/suggestions.

Upvotes: 3

Views: 731

Answers (3)

Waleed
Waleed

Reputation: 97

you can refer to this book, where it dose secure file wipe in objective-c http://shop.oreilly.com/product/0636920023234.do

Upvotes: -2

Manlio
Manlio

Reputation: 10865

You can use:

NSError *err;
NSFileManager *fileManager = [[NSFileManager alloc] init];
[fileManager removeItemAtPath:path error:&err];

where path is a NSString with the path of the file you want to delete.

Upvotes: 0

Ken Aspeslagh
Ken Aspeslagh

Reputation: 11594

AFAIK, move isn't going to copy the bytes, just change the pointers in the file system.

Upvotes: 1

Related Questions