dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Registry implementation (was Re: [DotGNU]PInvoke question...)


From: Rhys Weatherley
Subject: Registry implementation (was Re: [DotGNU]PInvoke question...)
Date: Thu, 24 Jul 2003 15:05:26 +1000
User-agent: KMail/1.4.3

Hi all,

I have added a simple flat file registry implementation to the CVS version of 
pnetlib, for non-Win32 platforms (Win32 will use the native registry routines 
as before).

Registry information is stored in ".cli/registry", under the user's home 
directory.  Each registry key level corresponds to a sub-directory, with 
values stored in a file called "values.reg".  The values are stored using a 
very simple XML-based format.

For example, data for "HKEY_CURRENT_USER\foo\bar" is stored in the file 
"$HOME/.cli/registry/CurrentUser/foo/bar/values.reg".

This structure was chosen because it was simple to implement, and extremely 
simple to debug.  If your registry becomes corrupted, then it will be easy to 
fix with your favourite text editor (or "rm -rf .cli/registry" in a pinch).

More information on the format can be found in the comments for the 
"Microsoft.Win32.FileKeyProvider" class.

Note: the current implementation isn't transactional.  If two or more 
processes try to modify a registry key at the same time, the result may be 
unpredictable.  Patches to add transaction support are welcome.

Cheers,

Rhys.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]