Updating /etc/hostconfig
Updating /etc/hostconfig
- Subject: Updating /etc/hostconfig
- From: Nicko van Someren <email@hidden>
- Date: Thu, 28 Oct 2004 00:38:55 +0100
Does anyone on this list know if there is a proscribed way for updating
the /etc/hostconfig file?
I'm building a service that will be run from a script in
/Library/StartupItems and it seems that most items here use a setting
in the hostconfig file to determine if they should start. The comments
in the hostconfig file say that the "file is maintained by the system
control panels" and I plan to add and update my entry there from a
preference pane. What I'm concerned with is the problem of multiple
accesses to the file at the same time.
I know I can use writeToFile:atomically: on a string to write the data
out to the file but the problem I foresee is that there will be a delay
between reading the contents of the file and writing it back. If
someone else writes changes to the file in between my program's read
and write then those changes can be lost. So my real question is do
other panels that edit this file worry about the issue and if so what
do they do to lock the file from multiple accesses?
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden