Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ncar!gatech!ncsuvx!ece-csc!rss From: rss@ece-csc.UUCP (Ralph Scherp) Newsgroups: comp.sys.amiga Subject: Re: calling all gurus Message-ID: <3482@ece-csc.UUCP> Date: 7 Apr 88 00:56:11 GMT References: <8804051628.AA27845@decwrl.dec.com> Reply-To: rss@ece-csc.UUCP (Ralph Scherp) Organization: North Carolina State University, Raleigh, NC Lines: 50 In article <8804051628.AA27845@decwrl.dec.com> kruger@16bits.dec.comh writes: >I am just starting to get involved with machine specifics of the Amiga, and >also suffer from extreme lack of time. However, the system is screaming for >a program that will set preferences from a file. ie: > >setpref mypreferences >setpref yourpreferences > > ... For that matter, is the format of system-config >even documented anywhere? If not, could anyone from CATS post it? > >Thanks! >dov Sure, I've done this. It's quite simple. I wanted the same capability to reset preferences because I have a hard drive, but the preferences which show up on the system are those sitting in df0: rather than on dh0: (after I've reassigned DEVS: to DH0); so I put together a simple (really!) program which loads in the preferences from the disk file (which is devs:system-configuration) and makes them the current preferences. The file "devs:system-configuration" is just an exact copy of the "Preferences" structure defined in intuition/intuition.h (I think) so all you have to do to reset preferences is: open the intuition library IntuitionBase = OpenLibrary("intuition.library",0); open the disk file devs:system-configuration (or your substitute file) fd = open("Devs:System-configuration",O_RDONLY,0); read the data into a struct Preferences read(fd,&pref,sizeof(pref)); (where "pref" is "struct Preference pref") issue a SetPrefs call (this is what makes it all work) SetPrefs(&pref,sizeof(pref),TRUE); close the library & file & exit. The program I wrote is very simple at present since I only intended it to fix preferences to reflect my hard drive configuration rather than that on my floppy, but it works. If you'd like, I'll mail you a copy or if there's enough interest I'll post it. I was thinking of enhancing the program to allow you to actually modify current preferences settings; i.e., I was considering writing a CLI equivalent to the existing Preferences program. How about it folks? Is there any interest in this? If so, I'll do it; else I'm not gonna bother. Maybe someone out there already has one? Hope this helps, Mark Lanzo (posting thru a friend's account)