V
V
Vitaly Gyrdasov2016-07-03 04:07:28
Cocoa
Vitaly Gyrdasov, 2016-07-03 04:07:28

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];

achieved a ban on renaming and nothing more.
Sandbox, of course, is used. Is it possible to somehow implement a ban on moving / deleting?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Semchenko, 2016-07-03
@mrdemkin

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 question

Ask a Question

731 491 924 answers to any question