I want to use the octal permissions (used for chmod) for NSFilePosixPermissions. Here is what I did now:
NSFileManager *manager = [NSFileManager defaultManager];
NSDictionary *attributes;
[attributes setValue:[NSString stringWithFormat:@"%d", 0777]
forKey:@"NSFilePosixPermissions"]; // chmod permissions 777
[manager setAttributes:attributes ofItemAtPath:@"/Users/lucky/Desktop/script" error:nil];
I get no error, but when I check the result with "ls -o" the permission are't -rwxrwxrwx.
What's wrong? Thanks for help.
NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithDictionary:[manager attributesOfItemAtPath:@"file..." error:nil]];
Next step I set the permissions and it worked! – Ruben