• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Updating /etc/hostconfig
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating /etc/hostconfig


  • Subject: Re: Updating /etc/hostconfig
  • From: Dan Bernstein <email@hidden>
  • Date: Wed, 3 Nov 2004 16:47:22 +0200

I think it's better not to use /etc/hostconfig at all. It's not meant
to be used by third-party software and it may even disappear
eventually. Instead, you can use your own appropriately-named settings
file in /etc or in /Library/Preferences ((if the file doesn't exists,
simply assume your service shouldn't be started).

-- Dan

On Thu, 28 Oct 2004 00:38:55 +0100, Nicko van Someren <email@hidden> wrote:
> 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
>
 _______________________________________________
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

  • Prev by Date: Lame problem with NSImageView
  • Next by Date: -[NSTextView setString:] causing app to lock up
  • Previous by thread: Re: Lame problem with NSImageView
  • Next by thread: -[NSTextView setString:] causing app to lock up
  • Index(es):
    • Date
    • Thread