Okay. Below is the code I am trying to use but it does not work. I am
trying to just use ditto to do the copy since it will preserve the
resource fork.
This code does not work and I do not have the knowledge to figure out
why.
When I run it nothing is copied, ditto never appears to launch, as I
watch it from the activity monitor. And I get an OSStatus return from
the run authorized command of -600031
I'm cannot remember how to read a pipe between ditto and the
authexecute command so that I can get an idea of might might be
happening but anyway, with any luck, some one here can help with
figure out the problem. Sorry about the messy code. Part of this is
just C&P from cageFighter something that the writer of it suggested I
look at for some guidance. The authorization seems to work but again
I don't know enough about it to even make that determination.
// execute cagefighter console app with privledges
if ( authorized ) {
// set prefs
// copy the files over
//here we will call the app and copy the files.
NSEnumerator * iter = [baseSystem objectEnumerator];
NSString * file;
//Okay in the working app we'll
[sysProgressWindow makeKeyAndOrderFront:self];
[sysProgress setIndeterminate:YES];
[sysProgress startAnimation:self];
int basecount =0;
[itemProgress setIndeterminate:YES];
[itemProgress startAnimation:self];
OSStatus result =
AuthorizationExecuteWithPrivileges( auth, systemCopier, 0, args, NULL );
[[NSRunLoop currentRunLoop]
runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.001]];
NSLog(@"Result %i",result);
[itemProgress incrementBy:1.0];
}//end of copy the file
}//end inner while loop
[itemProgress setIndeterminate:YES];
[itemProgress startAnimation:self];
}
}//end of while loop
}
// destroy auth rights
AuthorizationFree( auth, kAuthorizationFlagDestroyRights );
[thePool release];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden