Robert Brisita
Robert Brisita

Reputation: 5844

Setting NSFileBusy attribute in iOS

Has anyone gotten NSFileBusy to work? Using the test below, it does not work:

NSString* filePath = @"test.txt";
NSError* err = NULL;
NSDictionary* dic = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:TRUE] forKey:NSFileBusy];
BOOL res = [[NSFileManager defaultManager] setAttributes:dic ofItemAtPath:filePath error:&err];
dic = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:&err];
NSLog(@"File Busy %@", [dic objectForKey:NSFileBusy]);

Debugging shows that 'err' is null in both calls, the result of setAttributes is true, and the key 'NSFileBusy' is not in the attributes dictionary at all. Looked for some example implementations but could not find any. If someone can point me to the correct information or an example it would be greatly appreciated.

Upvotes: 2

Views: 678

Answers (1)

Aditya Vaidyam
Aditya Vaidyam

Reputation: 6267

Late, but nonetheless: iOS has no NSFileBusy because it should not have a graphical file representation like Finder: everything is sandboxed in apps.

Upvotes: 1

Related Questions