ファイルの移動

  1. 展開先にLupinX(Xは1から始まり、存在しないファイル名になるまで調べる)というディレクトリを作る。
  2. LupinX/に展開を行う。
  3. ディレクトリにLupinX下のファイルを全て移動する。
1.
NSFileManager* manager = [NSFileManager defaultManager];
[manager changeCurrentDirectoryPath:uncompressPath];
NSString* temporaryDirectoryName = @"Lupin";
int i;
for (i=1;;i++) {
	if ([manager fileExistsAtPath:temporaryDirectoryName])
		temporaryDirectoryName = [NSString stringWithFormat:@"Lupin%d",i];
	else
		break;
}
[manager createDirectoryAtPath:temporaryDirectoryName attributes:dic];

3.
NSString* filePath;
while ((filePath = [enumerator nextObject])) {
	result = [manager movePath:filePath toPath:parentPath handler:self];
	if (!result)
		NSLog(@"Failed to move from %@ to %@",filePath,parentPath);
}
[manager removeFileAtPath:temporaryDirectoryName handler:nil];

実際にはmovePathのhandlerに指定したオブジェクトに

-(BOOL)fileManager:(NSFileManager *)manager shouldProceedAfterError:(NSDictionary *)errorDict

が実装されていれば呼び出され、その中でYESを返せば処理に成功したことになります。
でもやっぱり使わないかも。