• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: piping a shell result to display it
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • initWithCoder failed in Cocoa-Java app
      • From: Greg Kramer <email@hidden>
References: 
 >piping a shell result to display it (From: Jean-Baptiste LE STANG <email@hidden>)

  • Prev by Date: Re: KeyCode <=> ASCII problem...
  • Next by Date: initWithCoder failed in Cocoa-Java app
  • Previous by thread: piping a shell result to display it
  • Next by thread: initWithCoder failed in Cocoa-Java app
  • Index(es):
    • Date
    • Thread