From 68d53c01b0b8e9a007a6a30158c19e34b2d2a34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Wed, 18 May 2016 15:53:35 +0200 Subject: Update STDLIB documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Language cleaned up by the technical writers xsipewe and tmanevik from Combitech. Proofreading and corrections by Björn Gustavsson and Hans Bolinder. --- lib/stdlib/doc/src/win32reg.xml | 193 ++++++++++++++++++++++++---------------- 1 file changed, 116 insertions(+), 77 deletions(-) (limited to 'lib/stdlib/doc/src/win32reg.xml') diff --git a/lib/stdlib/doc/src/win32reg.xml b/lib/stdlib/doc/src/win32reg.xml index 52a8942c59..f4a4fa1626 100644 --- a/lib/stdlib/doc/src/win32reg.xml +++ b/lib/stdlib/doc/src/win32reg.xml @@ -24,38 +24,39 @@ win32reg Bjorn Gustavsson - NN + - nobody - no + + 2000-08-10 PA1 - win32reg.sgml + win32reg.xml win32reg - win32reg provides access to the registry on Windows + Provides access to the registry on Windows. -

win32reg provides read and write access to the +

This module provides read and write access to the registry on Windows. It is essentially a port driver wrapped around the Win32 API calls for accessing the registry.

The registry is a hierarchical database, used to store various system - and software information in Windows. It is available in Windows 95 and - Windows NT. It contains installation data, and is updated by installers + and software information in Windows. + It contains installation data, and is updated by installers and system programs. The Erlang installer updates the registry by adding data that Erlang needs.

The registry contains keys and values. Keys are like the directories in a file system, they form a hierarchy. Values are like files, they have a name and a value, and also a type.

-

Paths to keys are left to right, with sub-keys to the right and backslash - between keys. (Remember that backslashes must be doubled in Erlang strings.) - Case is preserved but not significant. - Example: "\\hkey_local_machine\\software\\Ericsson\\Erlang\\5.0" is the key +

Paths to keys are left to right, with subkeys to the right and backslash + between keys. (Remember that backslashes must be doubled in Erlang + strings.) Case is preserved but not significant.

+

For example, + "\\hkey_local_machine\\software\\Ericsson\\Erlang\\5.0" is the key for the installation data for the latest Erlang release.

-

There are six entry points in the Windows registry, top level keys. They can be - abbreviated in the win32reg module as:

+

There are six entry points in the Windows registry, top-level keys. + They can be abbreviated in this module as follows:

-Abbrev.          Registry key
-=======          ============      
+Abbreviation     Registry key
+============     ============
 hkcr             HKEY_CLASSES_ROOT
 current_user     HKEY_CURRENT_USER
 hkcu             HKEY_CURRENT_USER
@@ -67,29 +68,39 @@ current_config   HKEY_CURRENT_CONFIG
 hkcc             HKEY_CURRENT_CONFIG
 dyn_data         HKEY_DYN_DATA
 hkdd             HKEY_DYN_DATA
-

The key above could be written as "\\hklm\\software\\ericsson\\erlang\\5.0".

-

The win32reg module uses a current key. It works much like the - current directory. From the current key, values can be fetched, sub-keys +

The key above can be written as + "\\hklm\\software\\ericsson\\erlang\\5.0".

+

This module uses a current key. It works much like the + current directory. From the current key, values can be fetched, subkeys can be listed, and so on.

-

Under a key, any number of named values can be stored. They have name, and +

Under a key, any number of named values can be stored. They have names, types, and data.

-

Currently, the win32reg module supports storing only the following - types: REG_DWORD, which is an - integer, REG_SZ which is a string and REG_BINARY which is a binary. - Other types can be read, and will be returned as binaries.

-

There is also a "default" value, which has the empty string as name. It is read and - written with the atom default instead of the name.

-

Some registry values are stored as strings with references to environment variables, - e.g. "%SystemRoot%Windows". SystemRoot is an environment variable, and should be - replaced with its value. A function expand/1 is provided, so that environment - variables surrounded in % can be expanded to their values.

-

For additional information on the Windows registry consult the Win32 +

win32reg supports storing of the following types:

+ + REG_DWORD, which is an integer + REG_SZ, which is a string + REG_BINARY, which is a binary + +

Other types can be read, and are returned as binaries.

+

There is also a "default" value, which has the empty string as name. It + is read and written with the atom default instead of the name.

+

Some registry values are stored as strings with references to environment + variables, for example, %SystemRoot%Windows. SystemRoot is + an environment variable, and is to be replaced with its value. Function + expand/1 is provided so that + environment variables surrounded by % can be expanded to their + values.

+

For more information on the Windows registry, see consult the Win32 Programmer's Reference.

+ -

As returned by open/1.

+ +

As returned by + open/1.

+
@@ -98,136 +109,164 @@ hkdd HKEY_DYN_DATA
+ - Move to a key in the registry + Move to a key in the registry. -

Changes the current key to another key. Works like cd. +

Changes the current key to another key. Works like cd. The key can be specified as a relative path or as an - absolute path, starting with \.

+ absolute path, starting with \.

+ - Move to a key, create it if it is not there + Move to a key, create it if it is not there.

Creates a key, or just changes to it, if it is already there. Works - like a combination of mkdir and cd. Calls the Win32 API function - RegCreateKeyEx().

-

The registry must have been opened in write-mode.

+ like a combination of mkdir and cd. + Calls the Win32 API function RegCreateKeyEx().

+

The registry must have been opened in write mode.

+ Close the registry. -

Closes the registry. After that, the RegHandle cannot - be used.

+

Closes the registry. After that, the RegHandle + cannot be used.

+ Return the path to the current key. -

Returns the path to the current key. This is the equivalent of pwd.

-

Note that the current key is stored in the driver, and might be - invalid (e.g. if the key has been removed).

+

Returns the path to the current key. This is the equivalent of + pwd.

+

Notice that the current key is stored in the driver, and can be + invalid (for example, if the key has been removed).

+ - Delete the current key + Delete the current key.

Deletes the current key, if it is valid. Calls the Win32 API - function RegDeleteKey(). Note that this call does not change the current key, - (unlike change_key_create/2.) This means that after the call, the - current key is invalid.

+ function RegDeleteKey(). Notice that this call does not change + the current key (unlike + + change_key_create/2). + This means that after the call, the current key is invalid.

+ Delete the named value on the current key.

Deletes a named value on the current key. The atom default is - used for the the default value.

-

The registry must have been opened in write-mode.

+ used for the default value.

+

The registry must have been opened in write mode.

+ - Expand a string with environment variables + Expand a string with environment variables.

Expands a string containing environment variables between percent - characters. Anything between two % is taken for a environment - variable, and is replaced by the value. Two consecutive % is replaced - by one %.

-

A variable name that is not in the environment, will result in an error.

+ characters. Anything between two % is taken for an environment + variable, and is replaced by the value. Two consecutive % are + replaced by one %.

+

A variable name that is not in the environment results in an + error.

+ - Convert an POSIX errorcode to a string + Convert a POSIX error code to a string. -

Convert an POSIX errorcode to a string (by calling erl_posix_msg:message).

+

Converts a POSIX error code to a string + (by calling erl_posix_msg:message/1).

+ - Open the registry for reading or writing + Open the registry for reading or writing. -

Opens the registry for reading or writing. The current key will be the root - (HKEY_CLASSES_ROOT). The read flag in the mode list can be omitted.

-

Use change_key/2 with an absolute path after open.

+

Opens the registry for reading or writing. The current key is the + root (HKEY_CLASSES_ROOT). Flag read in the mode list + can be omitted.

+

Use change_key/2 + with an absolute path after + open.

+ - Set value at the current registry key with specified name. + Set value at the current registry key with specified name. + -

Sets the named (or default) value to value. Calls the Win32 - API function RegSetValueEx(). The value can be of three types, and - the corresponding registry type will be used. Currently the types supported - are: REG_DWORD for integers, REG_SZ for strings and - REG_BINARY for binaries. Other types cannot currently be added - or changed.

-

The registry must have been opened in write-mode.

+

Sets the named (or default) value to value. Calls the Win32 + API function RegSetValueEx(). The value can be of three types, + and the corresponding registry type is used. The supported types + are the following:

+ + REG_DWORD for integers + REG_SZ for strings + REG_BINARY for binaries + +

Other types cannot be added or changed.

+

The registry must have been opened in write mode.

+ Get subkeys to the current key.

Returns a list of subkeys to the current key. Calls the Win32 API function EnumRegKeysEx().

-

Avoid calling this on the root keys, it can be slow.

+

Avoid calling this on the root keys, as it can be slow.

+ Get the named value on the current key.

Retrieves the named value (or default) on the current key. - Registry values of type REG_SZ, are returned as strings. Type REG_DWORD - values are returned as integers. All other types are returned as binaries.

+ Registry values of type REG_SZ are returned as strings. + Type REG_DWORD values are returned as integers. All other + types are returned as binaries.

+ Get all values on the current key.

Retrieves a list of all values on the current key. The values - have types corresponding to the registry types, see value. + have types corresponding to the registry types, see + value/2. Calls the Win32 API function EnumRegValuesEx().

- SEE ALSO -

Win32 Programmer's Reference (from Microsoft)

-

erl_posix_msg

-

The Windows 95 Registry (book from O'Reilly)

+ See Also +

erl_posix_msg, + The Windows 95 Registry (book from O'Reilly), + Win32 Programmer's Reference (from Microsoft)

-- cgit v1.2.3