NSFilemanager and secure delete
Is there any officially supported way of secur开发者_JAVA技巧e-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.
AFAIK, move isn't going to copy the bytes, just change the pointers in the file system.
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.
you can refer to this book, where it dose secure file wipe in objective-c http://shop.oreilly.com/product/0636920023234.do
精彩评论