• 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
Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
      • From: Sherm Pendley <email@hidden>
    • Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
      • From: Manfred Bergmann <email@hidden>
  • Prev by Date: QTMovieView and HTTP Redirects
  • Next by Date: Re: newbie interface problem
  • Previous by thread: Re: QTMovieView and HTTP Redirects
  • Next by thread: Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
  • Index(es):
    • Date
    • Thread