• 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: socko2: kill process by name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: socko2: kill process by name


  • Subject: Re: socko2: kill process by name
  • From: socko <email@hidden>
  • Date: Wed, 6 Feb 2002 12:39:36 -0800 (PST)

Dave,

thanks, but again:

> > i'm hoping there is some way to do it using Obj-C so i can
> > avoid Terminal altogether.

tcsh assumes Terminal implementation, doesn't it? i want to avoid using
Terminal.

i see that NSTask allows the opening (and termination) of a subprocess,
but don't we first need to know how to id the process? in my case, i want
to terminate a process that is already running.

am i missing something?


--- David Remahl <email@hidden> wrote:
> > i know a process can be killed by name, since ProcessViewer can filter
> by
> > name and kill a process. does anyone know how to (in Cocoa):
> >
> > 1. find a process by name
> > 2. kill that process
> >
> > i have been able to use the process name to get the process ID of the
> > process i want to kill in Terminal, but i don't know how to get the
> > process ID into a kill command once the process ID has been listed in
> > Terminal. i'm hoping there is some way to do it using Obj-C so i can
> > avoid Terminal altogether.
> > Send FREE Valentine eCards with Yahoo! Greetings!
> > http://greetings.yahoo.com
> > _______________________________________________
> > 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.
>
> I use this tcsh alias to be able to do things like "> pkill Finder":
>
> alias pkill 'kill `ps -x | grep \!^ | cut -c2-6 | head -n 1`'
>
> You can use that to adjust to your requirements...NSTask and NSPipe are
> the
> obj-C classes you will need...
>
> / david
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com
_______________________________________________
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:
    • Re: socko2: kill process by name
      • From: Finlay Dobbie <email@hidden>
  • Prev by Date: Apple Design Awards (Sorry, slightly OT)
  • Next by Date: Re: Multiple nibs
  • Previous by thread: Apple Design Awards (Sorry, slightly OT)
  • Next by thread: Re: socko2: kill process by name
  • Index(es):
    • Date
    • Thread