Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 14, 2012, 01:04 AM   #1
mehdies
macrumors member
 
Join Date: Jun 2012
launchd-Daemons run every second

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
mehdies is offline   0 Reply With Quote
Old Nov 14, 2012, 03:26 AM   #2
misee
macrumors member
 
Join Date: Jul 2010
See Running a Job Periodically
misee is offline   0 Reply With Quote
Old Nov 14, 2012, 08:17 AM   #3
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by mehdies View Post
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.
subsonix is offline   0 Reply With Quote
Old Nov 18, 2012, 05:32 AM   #4
mehdies
Thread Starter
macrumors member
 
Join Date: Jun 2012
Quote:
Originally Posted by subsonix View Post
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?
mehdies is offline   0 Reply With Quote
Old Nov 19, 2012, 10:10 AM   #5
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by mehdies View Post
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.
subsonix is offline   1 Reply With Quote
Old Nov 20, 2012, 05:14 AM   #6
mehdies
Thread Starter
macrumors member
 
Join Date: Jun 2012
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
mehdies is offline   0 Reply With Quote
Old Nov 20, 2012, 10:11 AM   #7
subsonix
macrumors 68030
 
Join Date: Feb 2008
Quote:
Originally Posted by mehdies View Post
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.
subsonix is offline   1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:40 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC