Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this questionI need to check whether "set Date and Time automatically" is checked or not on mac system preferences开发者_如何学C programmatically .
I didn't find any preferences plist file that it contains about this information,Can anybody suggest me from where can I fetch this information.
Thanks.
Actually I was trying to find that whether ntpd process is running or not at runtime.
This ntpd process can be started manually when the user checks set Date and Time automatically in System Preferences and stops when it is unchecked.
So,I was trying to find a flag that is writing in the system plist files.I did not find any.So I tried querying ntpd process state with lauchctl from the command line.
There by I could able to find the ntpd state.
精彩评论