Difference between revisions of "Ns config"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 535)
 
 
(One intermediate revision by one other user not shown)
Line 26: Line 26:
 
   off
 
   off
  
   % string length [[ns_config dummy dummy]]
+
   % string length [ns_config dummy dummy]
 
   0
 
   0
  
Line 38: Line 38:
 
----
 
----
  
[[Category Documentation]] - [[Category Core Tcl API]]
+
[[Category:Documentation]] - [[Category:Core Tcl API]]

Latest revision as of 19:48, 7 February 2009

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


-