Professional Web Applications Themes

Q About Cocoa & CF Prefs.. - Mac Programming

In article <no-EA814A.20172229072003netnews.upenn.edu>, Mark Haase <nospam.please> wrote: > It is my understanding that when you use the core foundation calls to > write to an application's preferences, those prefs are not necessarily > written out to file immediately, but cached in memory for a bit so that > potentially several can be written at once at a later point in time? > > What happens if your program crashes before the prefs get written out? > They're lost I suppose? Not only that, if the same preference file is accessed by multiple apps simultaneously, the last app to quit overwrites ...

  1. #1

    Default Re: Q About Cocoa & CF Prefs..

    In article <no-EA814A.20172229072003netnews.upenn.edu>,
    Mark Haase <nospam.please> wrote:
    > It is my understanding that when you use the core foundation calls to
    > write to an application's preferences, those prefs are not necessarily
    > written out to file immediately, but cached in memory for a bit so that
    > potentially several can be written at once at a later point in time?
    >
    > What happens if your program crashes before the prefs get written out?
    > They're lost I suppose?
    Not only that, if the same preference file is accessed by multiple apps
    simultaneously, the last app to quit overwrites any preferences written
    by the other apps. (According to the tips in the latest issue of
    MacAddict)

    Not only that, but if one app changes the preferences, the other apps
    that are accessing the preferences don't get an event to inform them
    that preferences have changed. (According to CarbonEvents.h)

    The entire API seems to have been written by programmers with room
    temperature IQs.

    To Apple: Get a clue guys! the file system handles robust multiple
    asynchronous access with updating, the preferences system could too.
    David Phillip Oster Guest

  2. #2

    Default Re: Q About Cocoa & CF Prefs..

    In article <no-EA814A.20172229072003netnews.upenn.edu>, Mark Haase
    <nospam.please> wrote:
    > It is my understanding that when you use the core foundation calls to
    > write to an application's preferences, those prefs are not necessarily
    > written out to file immediately, but cached in memory for a bit so that
    > potentially several can be written at once at a later point in time?
    Yes, but you can explicitly flush the cache.
    James W. Walker Guest

  3. #3

    Default Re: Q About Cocoa & CF Prefs..

    In article
    <oster-F5C4C7.20193229072003newssvr23-ext.news.prodigy.com>,
    David Phillip Oster <osterieee.org> wrote:
    > > What happens if your program crashes before the prefs get written out?
    > > They're lost I suppose?
    >
    > Not only that, if the same preference file is accessed by multiple apps
    > simultaneously, the last app to quit overwrites any preferences written
    > by the other apps. (According to the tips in the latest issue of
    > MacAddict)
    >
    > Not only that, but if one app changes the preferences, the other apps
    > that are accessing the preferences don't get an event to inform them
    > that preferences have changed. (According to CarbonEvents.h)
    My favorite "feature" is the complete loss of (unmodified) preferences
    in Dock, Finder, ... if the boot disk runs out of swap space :-(((

    Well, according to Files.h PBExchangeFiles appeared in InterfaceLib 7.1,
    so the write-and-swap-if-successful paradigm is only 10+ years old.


    Regards,
    Tom_E
    Thomas Engelmeier Guest

Similar Threads

  1. Rulers don't stay put in prefs
    By John_Carimando@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 1
    Last Post: May 11th, 11:44 PM
  2. where is prefs file in MXa?
    By Dritalei in forum Macromedia Freehand
    Replies: 7
    Last Post: May 7th, 10:11 AM
  3. Still No Toolbars Even After Deleting Prefs!
    By Stu.E.B webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 2
    Last Post: November 6th, 02:55 PM
  4. what is it with PS prefs?
    By hot_denim in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 11
    Last Post: August 5th, 05:37 AM
  5. hiding prefs in in system prefs
    By Larry Fransson in forum Mac Applications & Software
    Replies: 4
    Last Post: June 29th, 02:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139