Answer the question
In order to leave comments, you need to log in
How to block deletion of a file under OS X?
Good day!
An application in Objective-C, under OS X. While working, the user creates files from the application itself, which are then processed. It is necessary to make sure that during the operation of this application it is impossible to move or delete these files.
Via
NSDictionary *attributes = @{NSFileAppendOnly : @( 1 )};
NSFileManager *fileManager = [NSFileManager defaultManager];
error = nil;
[fileManager setAttributes:attributes ofItemAtPath:vUrl.path error:&error];
Answer the question
In order to leave comments, you need to log in
You can write a driver in (kernel mode) and hook file operations, but why do all this?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question