Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 9, 2005 11:12:48

Richard G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

GKeyFile use on Windows


I am looking at using the GKeyFile facility in GLIB for storing settings ofan application I am writing in Windows. While I can see how to retrievethe setting from a file there does not seem to be a function to write aGKeyFile to a disk file. So does this mean you have to create a GKeyFileusing g_key_file_new(), add the keys, then use g_key_file_to_data() towrite the data to a string, then write the string to a file? Or is theGKeyFile written to the registry some how?Richard.

_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#2 Nov. 9, 2005 19:31:43

Roger L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

GKeyFile use on Windows


Richard Gipps <> writes:

> While I can see how to retrieve the setting from a file there does
> not seem to be a function to write a GKeyFile to a disk file. So
> does this mean you have to create a GKeyFile using g_key_file_new(),
> add the keys, then use g_key_file_to_data() to write the data to a
> string, then write the string to a file?

Yes. You could use a GIOChannel, FILE or fd.

Personally, I write it out by hand using printf, since my application
data is not contained within the GKeyFile after I initially read the
GKeyFile off disk and extract the needed information. I may revisit
that, though.

> Or is the GKeyFile written to the registry some how?

They have nothing to do with each other.

--
Roger Leigh
Printing on GNU/Linux?http://gimp-print.sourceforge.net/Debian GNU/Linuxhttp://www.debian.org/GPG Public Key: 0x25BFB848. Please sign and encrypt your mail.
_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support