Ns config

From AOLserver Wiki
Revision as of 12:05, 21 November 2007 by Lemuelf (talk | contribs) (removed doubling of brackets in a tcl command in the example code so it doesn't appear as a wiki link)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_config.html


NAME

ns_config - Extract configuration information from the server

SYNOPSIS

ns_config ?-exact | -bool | -int? section key ?default?

DESCRIPTION

This command returns the value associated with the key in the specified section of the current server's configuration. If default is specified, and the section and key are not defined, then default is returned. If default is not specified in this situation, an empty string is returned.

If -exact is specified, matching on key is case-sensitive. By default, matching is case-insensitive.

If -bool is specified, ns_config will perform the conversion of a boolean value from "on", "1", "y", "yes", "t", and "true" to "1", and it will convert a boolean value of "off", "0", "n", "no", "f", and "false" to "0". If a boolean contains any other value, a warning is written to the server log and an empty string is returned. If the configuration value is not defined, an empty string is returned.

If -int is specified, ns_config will return the integer value of the specified key. If there is a non-integer value in the configuration, a warning is written to the log file and an empty string is returned.

EXAMPLES

 % ns_config ns/parameters debug
 off
 % string length [ns_config dummy dummy]
 0
 % ns_config dummy dummy default
 default

SEE ALSO

ns_configsection, ns_configsections


Category Documentation - Category Core Tcl API