Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
- Subject: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
- From: Mark Williams <email@hidden>
- Date: Tue, 4 Oct 2005 17:34:39 -0700
Hi,
Im using:
OSStatus result = AuthorizationExecuteWithPrivileges( auth, copier,
0, args, &dittoOut);
to execute ditto and copy files. I use ditto to preserve the
resource fork. Anyway, how do I read the data from dittoOut into a
char array or some other string so that I can display it on the screen?
I tried
char inpt;
char line[1024];
int ctr=0;
while(inpt = getc(dittoOut) !=EOF){
line[ctr] = inpt;
ctr++;
}
line[ctr]='\0'
NSLog(@"%s",line);
but all I get is an empty string.
dittoOut is initialized as FILE * dittoOut = NULL;
i never use fopen because I thought I wasn't suppose to. And
according to the man page ditto writes all it's data to stderr when
you use the "-V" argument, which is one of the arguments I am passing
to the tool.
Can some one help me out ?
Mark.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden