• 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: [NewB] calling shell from ObjC within a PreferencesPane
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NewB] calling shell from ObjC within a PreferencesPane


  • Subject: Re: [NewB] calling shell from ObjC within a PreferencesPane
  • From: "Alan Smith" <email@hidden>
  • Date: Tue, 31 Oct 2006 08:38:10 -0500

Hi Yvon,

There are two ways:

NSTask (Check Apples docs for info on this class)
system(You provide a string (eg. "ls -alh /"))

Good luck, Alan

PS. Questions such as this one have been asked *very* many times.
Always search this lists archive at cocoabuilder.com before posting,
saves you/us time and some of us get *really* annoyed when people ask
a common question.

On 10/31/06, Yvon Thoraval <email@hidden> wrote:
Hey all,

i'm writing a preferences pane for a light nntp server "LeafNode"
<http://leafnode.sourceforge.net/>.

in order to start this server i'm using a launchd "LaunchDaemons" .

the plist being "/Library/LaunchDaemons/net.sourceforge.leafnode.plist"

the the agent label "net.sourceforge.leafnode".

i know the wat to start/stop yjis server from command line.

however i'd designing a preference pane able to start/stop this
server provided the user authentificate as admin.

the basic way to start the server using the terminal being :

 > sudo launchctl start net.sourceforge.leafnode

then my question is how could i call launchdctl from ObjC ?

i know how to call shell script from AppleScript and Ruby but not *
at all * from ObjC.

also i will have to open a window for the user to authentificate, are
they special window/panel for that ?

i said one question , i do have other.

this server as process to be put in daily crontab, i know how to use
the crontab under shell but how from ObjC.

best,

Yvon


_______________________________________________ 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



--
// Quotes from yours truly -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that religion really is unimportant, then it
shall evolve."
_______________________________________________
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


References: 
 >[NewB] calling shell from ObjC within a PreferencesPane (From: Yvon Thoraval <email@hidden>)

  • Prev by Date: [NewB] calling shell from ObjC within a PreferencesPane
  • Next by Date: Customizing NSMenuItem
  • Previous by thread: [NewB] calling shell from ObjC within a PreferencesPane
  • Next by thread: Re: [NewB] calling shell from ObjC within a PreferencesPane
  • Index(es):
    • Date
    • Thread