No. Don't look at the preferences plist. That file will only change when the settings change, not when the network state changes. Use SystemConfiguration.framework. There are APIs to watch for changes in the dynamic store. scutil is a command line tool you may use to explore the dynamic store on your system.
Sent from my iPhone On Jul 19, 2009, at 8:06, Ian Mark Salvame < email@hidden> wrote:
> Hello, > >> Any suggestions how to do this? >> It seems that there's no way of doing this through launchd. > >There is, you have to watch specifically the file >/Library/Preferences/SystemConfiguration/preferences.plist via LaunchD >for changes then interpret what they are according to your criteria. I >wrote a simple scripted system that detected network location changes >this way by comparing the current location to the existing one to >detect a user initiated change of network location. It's not perfect >but sufficed for what I was trying to do. I imagine with more >time/effort using the SystemConfiguration frameworks would do the job >with the agents to tell you what's going on. > >Philip
Thanks for the info. I have tried this before but I am not sure if I'm doing the right thing or not.
But is it a guarantee that the preferences.plist
always gets updated whenever there are changes to the network interfaces.
Ian
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|