Author Topic: Procedure for replacing the WeatherCat preference file?  (Read 4039 times)

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6499
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Procedure for replacing the WeatherCat preference file?
« on: December 18, 2014, 11:19:33 PM »
Dear Blick, Stu, and WeatherCat troubleshooters,

I'm hijacking a post from another thread to ask a question.

If you are referring to WeatherCat Preferences being frozen, you need to quit WeatherCat, delete the plist file, empty the trash, reboot WeatherCat and then go through Preferences and reset your settings. A frozen preferences window means that your plist file is corrupt and needs to be rebuilt.

Yosemite seems to be "good"  [rolleyes2] at corrupting preference files.  Every-time I reboot my Mac, I have to replace the preference files for TotalSpaces2.  And since I haven't had time to zap that darn PRAM, that's once a week.

It is really easy to avoiding having to change all your preferences.  Just make a backup copy of the file:com.trixology.weathercat.plist that you'll find in the folder:

~/Library/Preferences

I just used the name: com.trixology.weathercat backup.plist and left it in the same folder.  So if something goes wrong, drag the corrupted file to the trash, copy your backup to the name:  com.trixology.weathercat.plist and you are back in business.

What I'm not sure about is the procedure to get WeatherCat to load the replacement preference file.  Obviously quit WeatherCat before replacing the file.  However, I recall Stu saying something about having to reboot also.  So what is the correct procedure?

  • Can you: quit WeatherCat, replace the preference file with the backup, and start WeatherCat again? . . . . or
  • Must you: quit WeatherCat, replace the preference file with the back, reboot your Mac, and only then startup WeatherCat?

Curious minds want to know!

Cheers, Edouard  [cheers1]

Blicj11

  • Storm
  • *****
  • Posts: 3951
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Procedure for replacing the WeatherCat preference file?
« Reply #1 on: December 20, 2014, 09:30:25 AM »
Great question Edouard. Starting with Mavericks, Apple made a significant change in the way preference files are handled. Starting with Mavericks, preferences are now managed by a background daemon, called cfprefsd. If you delete a plist file and restart the program (like we did before Mavericks), the old plist file is retrieved from cache by the daemon and it is as if it was never deleted in the first place. So now there is an extra step. Delete the plist, empty the trash and reboot OS X. This sequence creates a new plist.

It is really easy to avoiding having to change all your preferences.  Just make a backup copy of the file:com.trixology.weathercat.plist that you'll find in the folder:

~/Library/Preferences

I just used the name: com.trixology.weathercat backup.plist and left it in the same folder.  So if something goes wrong, drag the corrupted file to the trash, copy your backup to the name:  com.trixology.weathercat.plist and you are back in business.

What I'm not sure about is the procedure to get WeatherCat to load the replacement preference file.  Obviously quit WeatherCat before replacing the file.  However, I recall Stu saying something about having to reboot also.  So what is the correct procedure?

  • Can you: quit WeatherCat, replace the preference file with the backup, and start WeatherCat again? . . . . or
  • Must you: quit WeatherCat, replace the preference file with the back, reboot your Mac, and only then startup WeatherCat?

I like your idea and agree that it is a faster way to obtain a new plist file. If you just replace your plist and restart WeatherCat, it will still pull up the old plist from cache. A reboot after deleting the old plist is what clears the old plist from the cache. I believe your Must You sequence will do the trick. Here is another methods that I believe you can use to do this:
  • Quit WeatherCat
  • Open Terminal
  • type "killall cfprefsd" in Terminal and hit the Return key
  • Copy the prefs file you want to use into its home -  or rename as in your example
  • Launch WeatherCat
The killall cfprefsd command flushes all of the plist settings currently being used out of cache. Since you are replacing the old WeatherCat plist with your backup plist, when the 'Cat is launched it will read from the new plist. The non-WeatherCat plists that got flushed with the killall command will not be affected because they will simply get regenerated from their original plists.
Blick


Felix

  • Gale
  • ****
  • Posts: 439
  • Station Details: Davis VP-2 Plus, FARS, WeatherLink IP. Sharx cams.
Re: Procedure for replacing the WeatherCat preference file?
« Reply #2 on: December 20, 2014, 10:50:19 AM »
Thanks for the pref file info, Blick. That'll come in handy at some point I'm quite sure.

Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: Procedure for replacing the WeatherCat preference file?
« Reply #3 on: December 20, 2014, 01:20:24 PM »
Hi Blicj and plist questioniers
 I like your terminal idea but won't that clear all plist even for other programs and if your not replacing them won't you now have to go back in put in the info for other programs that have plist?


just need to know


thanks


cheers


 [cheers1]

Blicj11

  • Storm
  • *****
  • Posts: 3951
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Procedure for replacing the WeatherCat preference file?
« Reply #4 on: December 20, 2014, 03:38:59 PM »
I like your terminal idea but won't that clear all plist even for other programs and if your not replacing them won't you now have to go back in put in the info for other programs that have plist?

Randall, the answer is no (or yes, but not really). Yes, it flushes all plist data from the daemon cache. However, the only program affected by this in this instance is WeatherCat, because you have replaced its plist with a new one before you launch the app. All other programs that happened to have plist memory flushed will simply reload their plist data back into the cache the next time you open them. The killall command does not delete any plist files. It only flushes plist data from the daemon cache. Edouard method of having a back plist file for WeatherCat allows you to not have to manually re-enter all of your settings. The killall command simply allows OS X to load your new, uncorrupted, plist file instead of your old corrupted one. Since you have not made any changes to your other (non-WeatherCat plists), they will simply reload data into the daemon cache the next time you launch those apps, as if nothing happened.

DISCLAIMER
I have not actually tried Edouard's idea yet, I am just sharing theory with you of how it is supposed to work in Mavericks and Yosemite. But it should work, and I have made a duplicate of of my WeatherCat plist file to try the next time this occurs. It doesn't happen too often, but it has happened to me once since I upgraded to Yosemite, and a number of fellow WeatherCatters have had to delete and rebuild their plist after upgrading to Yosemite.
Blick


Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: Procedure for replacing the WeatherCat preference file?
« Reply #5 on: December 20, 2014, 03:48:05 PM »
Hi Blicj
 Thanks for clearing that up
I have always used this method I have a backup plist on a disc which I also have locked so no changes can be made to it
1. Quit WeatherCat
2. Move com.trixology.weathercat.plist to the trash
3. Empty the trash
4. Replace the com.trixology.weathercat.plist from the backup disc
5. Restart my iMac


All should be good to go


cheers


 [cheers1]

Blicj11

  • Storm
  • *****
  • Posts: 3951
    • EW3808
    • KUTHEBER6
    • Timber Lakes Weather
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP Data Logger | iMac (2019), 3.6 GHz Intel Core i9, 40 GB RAM, macOS Ventura 13.6 | Sharx SCNC2900 Webcam | WeatherCat 3.3 | Supportive Wife
Re: Procedure for replacing the WeatherCat preference file?
« Reply #6 on: December 20, 2014, 10:23:41 PM »
Yes, Randall, that is Edouard's second method at it works for sure.
Blick


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6499
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Thanks! (Re: Procedure for replacing the WeatherCat preference file?)
« Reply #7 on: December 20, 2014, 11:11:36 PM »
Dear Blick, Randall, and WeatherCat tinkerers,

Thanks for the information!

I like your idea and agree that it is a faster way to obtain a new plist file. If you just replace your plist and restart WeatherCat, it will still pull up the old plist from cache. A reboot after deleting the old plist is what clears the old plist from the cache. I believe your Must You sequence will do the trick. Here is another methods that I believe you can use to do this:
  • Quit WeatherCat
  • Open Terminal
  • type "killall cfprefsd" in Terminal and hit the Return key
  • Copy the prefs file you want to use into its home -  or rename as in your example
  • Launch WeatherCat
The killall cfprefsd command flushes all of the plist settings currently being used out of cache. Since you are replacing the old WeatherCat plist with your backup plist, when the 'Cat is launched it will read from the new plist. The non-WeatherCat plists that got flushed with the killall command will not be affected because they will simply get regenerated from their original plists.

Okay, this makes sense.  I'll need to look into this, but it would be desirable to avoid having to reboot every time you need to restore a preference file.  However, as you and Randall note - rebooting after replacing the file always works.  What puzzles me a little bit, is that when I replace the preference file of TotalSpaces2, it does work even if I don't reboot immediately afterwards.  Unfortunately, there is something wrong with TotalSpaces2 at the moment and I need to replace the preference files after every reboot. 

Oh well!

Cheers, Edouard  [cheers1]