Re: piping a shell result to display it
Re: piping a shell result to display it
- Subject: Re: piping a shell result to display it
- From: Chris Ridd <email@hidden>
- Date: Wed, 14 May 2003 17:57:25 +0100
On 15/5/03 12:52 am, Jean-Baptiste LE STANG <email@hidden>
wrote:
>
This is the first time i'm writting an application. i'm trying to make
>
a small palette that would allow me to start/stop Apache Web Server
>
with a click in it. I'm also trying to log the result of the shell
>
script that start/stop the Web Server. this is what i'm doing :
>
>
>
NSLog(@"restart");
>
char* args[2];
>
err = 0;
>
FILE* iopipe;
>
iopipe = fopen("log.txt","a+");
>
fclose(iopipe);
>
args[0] = "restart";
>
args[1] = NULL;
>
err =
>
AuthorizationExecuteWithPrivileges(authorizationRef,"/usr/sbin/
>
apachectl",0, args, &iopipe);
>
>
But there is nothing in the "log.txt" file. What I am doing wrong here?
AuthorizationExecuteWithPrivileges creates its own FILE *, according to
<
http://developer.apple.com/techpubs/macosx/CoreTechnologies/securityservice
s/authorizationservices/authorization_ref/01authref_ref/function_group_4.htm
l>
so I'd guess it is simply stomping on your FILE *.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.