Darkshadow
wandering shadow
Anybody out there know how to do this one programatically? I'm currently using an NSTask to run a shell script that does ps | grep then echo to return if it's running or not, but this creates 4 new processes...this thing polls every 45 seconds, so my process numbers shoot up like no tomorrow. This isn't a bad thing, but it annoys the heck outta me, and if it annoys me, I'm sure it'll annoy someone else if I release it as it is now.
I know Cocoa can't do this, so I'm turnin to good 'ole C to figure it out. I tried sys/proc.h, but I can't even figure out how to fill out the structs and such. Anyone out there done this before? Basically, I'm just trying to re-invent ps myself (I suppose), and then see if the process is running. If anyone knows an easier way than this, let me know! (The process, BTW, is a CLI one).
I know Cocoa can't do this, so I'm turnin to good 'ole C to figure it out. I tried sys/proc.h, but I can't even figure out how to fill out the structs and such. Anyone out there done this before? Basically, I'm just trying to re-invent ps myself (I suppose), and then see if the process is running. If anyone knows an easier way than this, let me know! (The process, BTW, is a CLI one).