Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mehdies

macrumors member
Original poster
Jun 10, 2012
41
0
Hi guys,

How i create a .plist file in /Library/LaunchDaemons that runs a executable file every second?

i mean my application execute every second.


thanks
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Hi guys,

How i create a .plist file in /Library/LaunchDaemons that runs a executable file every second?

i mean my application execute every second.


thanks

What are you trying to do exactly? With a 1 second time frame it sounds like you would want to keep the application alive and run it in a loop with a one second sleep instead.
 

mehdies

macrumors member
Original poster
Jun 10, 2012
41
0
What are you trying to do exactly? With a 1 second time frame it sounds like you would want to keep the application alive and run it in a loop with a one second sleep instead.


Yes,I exactly want to keep application alive.how can i do that?
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Yes,I exactly want to keep application alive.how can i do that?

With launchd and by setting a KeepAlive property to true in the property list that is associated with your program/script. The reason I asked what you where doing is that it sounds suspiciously much like polling and there may be better options available.
 

mehdies

macrumors member
Original poster
Jun 10, 2012
41
0
I have an application .... this application has connection with kernel(a kext) and get a buffer from kext and write to file.i want to increase speed of getting and writing process so when buffer has even 1 character my daemon get that and write to file.
My application must check the buffer consecutive.
Now could you help me?


Thanks
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
I have an application .... this application has connection with kernel(a kext) and get a buffer from kext and write to file.i want to increase speed of getting and writing process so when buffer has even 1 character my daemon get that and write to file.
My application must check the buffer consecutive.
Now could you help me?

Thanks

I did, use the KeepAlive property and set it to true in your property list. I don't know off the top of my head what options you have besides polling in your particular case, but it's probably worth investigating.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.