• 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
Stdout Reading from an Asynchronous Task started with AuthorizationExecuteWithPrivileges
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stdout Reading from an Asynchronous Task started with AuthorizationExecuteWithPrivileges


  • Subject: Stdout Reading from an Asynchronous Task started with AuthorizationExecuteWithPrivileges
  • From: email@hidden
  • Date: Fri, 28 Nov 2003 01:03:18 -0500

I have called AuthorizationExecuteWithPrivileges and have passed a FILE pointer as the optional fifth argument as shown:

err = AuthorizationExecuteWithPrivileges(authorizationRef, [pathToCommand cString], 0, NULL, &communicationsPipe);

Is it possible to handle this pipe as a NSFileHandle by doing the following:

fileHandle = [[NSFileHandle alloc] initWithFileDescriptor:fileno (communicationsPipe) closeOnDealloc:YES];

It seems to work, but I can't get it to output when I try to readInBackgroundAndNotify. Does anyone have any suggestions or sample code for asynchronous reading of the pipe returned from AuthorizationExecuteWithPrivileges.

Even better, does anyone have an object for running authenticated tasks like NSTask. BLAuthentication is great and all, but it does use shared instances. =)

Thanks in advance,
Matt
_______________________________________________
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.

  • Prev by Date: Re: Setting contents of NSTextField to NSCalendarDate
  • Next by Date: Finding out the user's group
  • Previous by thread: Re: Changing the text of an NSTextView without killing undos
  • Next by thread: Finding out the user's group
  • Index(es):
    • Date
    • Thread