와하하하하핳 성공했다!!!ㅋㅋㅋ
어제+오늘 아침 아이폰으로 열심히 아무리 찾아도 없더니 오늘 다시 한 5분 찾으니 바로 나오네..ㅡㅡ
아 기분 좋긴 한데 살짝 빡..;;ㅋㅋ
permission 이라 암만 검색해도 안나오던데.. filemanager에 떡하니 nil이란 인수를 받고 있는 attributes 가 정답.. 아놔.. 미리 볼껄..ㅠㅠㅠㅠ
내가 검색한 소스는
(아마 디렉토리 퍼미션 변경인듯..... 적당히 수정하자.)
- (void)chmodOpen
{
NSString *path = @"/hardcoded_path_of_directory";
NSFileManager *manager = [[[NSFileManager alloc] init] autorelease];
BOOL isDir;
if ([manager fileExistsAtPath:path isDirectory:&isDir]&&isDir) {
NSDictionary *attrib = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithUnsignedLong:511], NSFilePosixPermissions, nil ];
NSError *error = nil;
[manager setAttributes:attrib ofItemAtPath:path error:&error];
}
//Basically chmod 777 on directory;
}
이것.
중간에 numberWithUnsignedLong: 값을 수정함으로써 권한 설정을 바꿀 수 있다.
511:777
493:755
확인 방법은
int perm = 0755;
NSLog(@"%d %o", perm, perm);
'개발개발 > Mac, iOS' 카테고리의 다른 글
| LibActivator add Event (Not Listners) (0) | 2011.08.08 |
|---|---|
| substrate Extension 과 LibActivator 연동하기 (0) | 2011.05.01 |
| Xcode - Device Log 보기 (0) | 2011.02.23 |
| BundleIdentifier로 앱 정보 구하기 (4) | 2011.02.23 |
| 앱 설치 여부 구하기 (0) | 2011.02.22 |