<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gustafn</id>
	<title>AOLserver Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://panoptic.com/mediawiki/aolserver/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gustafn"/>
	<link rel="alternate" type="text/html" href="https://panoptic.com/wiki/aolserver/Special:Contributions/Gustafn"/>
	<updated>2026-04-08T05:20:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Annotated_AOLserver_Configuration_Reference&amp;diff=5318</id>
		<title>Annotated AOLserver Configuration Reference</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Annotated_AOLserver_Configuration_Reference&amp;diff=5318"/>
		<updated>2009-02-09T09:54:36Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: added to fastpath options: directoryfile, directorylisting, directoryproc and directoryadp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''[ Please make comments on the [[Talk:Annotated_AOLserver_Configuration_Reference]] page. ]'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    #&lt;br /&gt;
    # config-reference.tcl.txt --&lt;br /&gt;
    #&lt;br /&gt;
    #      Annotated AOLserver Configuration Reference&lt;br /&gt;
    #&lt;br /&gt;
    #      Nearly every AOLserver configuration variable is represented&lt;br /&gt;
    #      here.  This file is provided as a reference -- please do not load&lt;br /&gt;
    #      this into your server.&lt;br /&gt;
    #&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Global parameters&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/parameters&amp;quot;&lt;br /&gt;
    ns_param   home            $home     ;# Server's home directory&lt;br /&gt;
       &lt;br /&gt;
    # Limits&lt;br /&gt;
    ns_param   listenbacklog   32        ;# Max length of pending conn queue&lt;br /&gt;
    ns_param   schedmaxelapsed 2         ;# Warn when waiting on really long procs&lt;br /&gt;
    ns_param   shutdowntimeout 20        ;# Secs to wait on shutdown if open conns&lt;br /&gt;
    &lt;br /&gt;
    # Server logging&lt;br /&gt;
    ns_param   dev             true      ;# Display logging with &amp;quot;Dev&amp;quot; severity&lt;br /&gt;
    ns_param   debug           false     ;# Display logging with &amp;quot;Debug&amp;quot; severity&lt;br /&gt;
    ns_param   logexpanded     false     ;# true = double-spaced server.log&lt;br /&gt;
    ns_param   logroll         false     ;# Roll server.log every 24 hours.&lt;br /&gt;
    ns_param   maxbackup       10        ;# Max number of old server.log files&lt;br /&gt;
    ns_param   pidfile         &amp;quot;nspid&amp;quot;   ;# PID of server (named &amp;quot;nspid.PORT&amp;quot;)&lt;br /&gt;
    ns_param   serverlog       &amp;quot;server.log&amp;quot; ;# Filename of server.log&lt;br /&gt;
    &lt;br /&gt;
    # DNS tuning&lt;br /&gt;
    ns_param   dnscache        true      ;# In-memory cache of DNS lookups&lt;br /&gt;
    ns_param   dnscachetimeout 60        ;# How long to keep hostnames in cache&lt;br /&gt;
    &lt;br /&gt;
    # Miscellaneous&lt;br /&gt;
    ns_param   mailhost        smtp.yourcompany.com ;# SMTP host for ns_sendmail&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Thread library (nsthread) parameters&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/threads&amp;quot;&lt;br /&gt;
    ns_param   mutexmeter      true      ;# measure lock contention&lt;br /&gt;
    ns_param   stacksize       [expr 128*1024]  ;# stack size per thread (in bytes)&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # MIME types.&lt;br /&gt;
    #&lt;br /&gt;
    # Note: AOLserver already has an exhaustive list of MIME types, but in&lt;br /&gt;
    # case something is missing you can add it here.&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/mimetypes&amp;quot;&lt;br /&gt;
    ns_param   &amp;quot;.xls&amp;quot;          &amp;quot;application/vnd.ms-excel&amp;quot;&lt;br /&gt;
    ns_param   default         &amp;quot;*/*&amp;quot;     ;# MIME type for unknown extension&lt;br /&gt;
    ns_param   noextension     &amp;quot;*/*&amp;quot;     ;# MIME type for missing extension&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    ############################################################&lt;br /&gt;
    #&lt;br /&gt;
    # Server-level configuration&lt;br /&gt;
    #&lt;br /&gt;
    #  There is only one server in AOLserver, but this is helpful when multiple&lt;br /&gt;
    #  servers share the same configuration file.  This file assumes that only&lt;br /&gt;
    #  one server is in use so it is set at the top.&lt;br /&gt;
    #&lt;br /&gt;
    &lt;br /&gt;
    ns_section &amp;quot;ns/servers&amp;quot;&lt;br /&gt;
    ns_param   $server         $servername ;# Name of virtual server.&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Server parameters&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}&amp;quot;&lt;br /&gt;
    ns_param   directoryfile   $directoryfile ;# List of files to use (index.html)&lt;br /&gt;
    ns_param   pageroot        $pageroot ;# Directory under which all pages live&lt;br /&gt;
    &lt;br /&gt;
    # Tuning options&lt;br /&gt;
    ns_param   connsperthread  0         ;# Normally there's one conn per thread&lt;br /&gt;
    ns_param   maxthreads      20        ;# Tune this to scale your server&lt;br /&gt;
    ns_param   minthreads      0         ;# Tune this to scale your server&lt;br /&gt;
    ns_param   threadtimeout   120       ;# Idle timeout for connection threads&lt;br /&gt;
    ns_param   maxconnections  100       ;# Max connections per connection thread before it is shut down&lt;br /&gt;
    ns_param   spread          20        ;# Variance factor for threadtimeout and maxconnections&lt;br /&gt;
                                         ;# to prevent mass mortality of theads (e.g. +-20%) &lt;br /&gt;
    &lt;br /&gt;
    # Limits&lt;br /&gt;
    ns_param   maxline         8192      ;# Max line length from client&lt;br /&gt;
    &lt;br /&gt;
    # Directory listings can be generated with an ADP or a Tcl proc.&lt;br /&gt;
    ns_param   directoryadp    $home/dirlist.adp  ;# Choose one or the other&lt;br /&gt;
    ns_param   directoryproc   _ns_dirlist        ;#  ...but not both!&lt;br /&gt;
    ns_param   directorylisting simple   ;# Can be simple or fancy (for ns_dirlist)&lt;br /&gt;
    &lt;br /&gt;
    # Miscellaneous&lt;br /&gt;
    ns_param   checkmodifiedsince true   ;# Check url if no If-Modified-Since?&lt;br /&gt;
    ns_param   enableaolpress  false     ;# Enable extra features used by AOLpress&lt;br /&gt;
    ns_param   headercase      preserve  ;# tolower, toupper, preserve&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Internal redirects&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/redirects&amp;quot;&lt;br /&gt;
    ns_param   404 &amp;quot;/notfound.html&amp;quot;      ;# Not Found error page&lt;br /&gt;
    ns_param   500 &amp;quot;/servererror.html&amp;quot;   ;# Server Error page&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Fastpath serves HTML&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/fastpath&amp;quot;&lt;br /&gt;
    ns_param   cache           true      ;# Enable cache for normal URLs; default: false&lt;br /&gt;
    ns_param   cachemaxentry   8192      ;# Largest file size allowable in cache; default: cachemaxsize/10&lt;br /&gt;
    ns_param   cachemaxsize    [expr 5000*1024] ;# Size of fastpath cache; default: 5120000&lt;br /&gt;
    ns_param   mmap            false     ;# Use mmap() for cache; default: false&lt;br /&gt;
    ns_param   directoryfile   index.adp,index.tcl,index.html,index.htm &lt;br /&gt;
                                         ;# String. Directory index/default page to look for. &lt;br /&gt;
                                         ;# Optional, default is directoryfile parameter set in &lt;br /&gt;
                                         ;# ns/server/${servername} section.&lt;br /&gt;
    ns_param   directorylisting fancy    ;# Directory listing style. &lt;br /&gt;
                                         ;# Optional, can be &amp;quot;fancy&amp;quot; or &amp;quot;simple&amp;quot;. &lt;br /&gt;
    ns_param   directoryproc _ns_dirlist ;# String. Name of Tcl proc to use to display&lt;br /&gt;
                                         ;# directory listings. Optional, default is to use&lt;br /&gt;
                                         ;# _ns_dirlist. You can either specify directoryproc,&lt;br /&gt;
                                         ;# or directoryadp - not both.&lt;br /&gt;
    ;#ns_param directoryadp dir.adp      ;# String. Name of ADP page to use to display directory &lt;br /&gt;
                                         ;# listings. Optional. You can either specify directoryadp &lt;br /&gt;
                                         ;# or directoryproc - not both.&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Tcl interpreter&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/tcl&amp;quot;&lt;br /&gt;
    ns_param   debug           false     ;# Names of files sourced is logged&lt;br /&gt;
    ns_param   nsvbuckets      8         ;# No. of buckets to hold nsv's&lt;br /&gt;
    ns_param   library  &amp;quot;$home/servers/${servername}/modules/tcl&amp;quot; ;# Private tcl library for the server&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # ADP (AOLserver Dynamic Page) configuration&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/adp&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # ADP features&lt;br /&gt;
    ns_param   map             &amp;quot;/*.adp&amp;quot;  ;# Extensions to parse as ADP's&lt;br /&gt;
    ns_param   map             &amp;quot;/*.html&amp;quot; ;# Any extension can be mapped&lt;br /&gt;
    ns_param   enableexpire    true      ;# Set &amp;quot;Expires: now&amp;quot; on all ADP's&lt;br /&gt;
    ns_param   enabledebug     true      ;# Turn on Tclpro debugging with &amp;quot;?debug&amp;quot;&lt;br /&gt;
    ns_param   debuginit &amp;quot;ns_adp_debuginit&amp;quot; ;# Debug procedure&lt;br /&gt;
    &lt;br /&gt;
    # ADP tuning&lt;br /&gt;
    ns_param   cache           true      ;# In-memory cache of ADP's&lt;br /&gt;
    ns_param   cachesize       [expr 5000*1024]&lt;br /&gt;
    &lt;br /&gt;
    # ADP special pages&lt;br /&gt;
    ns_param   errorpage  ${pageroot}/errorpage.adp        ;# Pretty-print ADP errors with an ADP&lt;br /&gt;
    ns_param   startpage  ${pageroot}/startpage.inc        ;# Page to include for all ADP's&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # ADP custom parsers -- see adp.c&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/adp/parsers&amp;quot;&lt;br /&gt;
    ns_param   adp             &amp;quot;.adp&amp;quot;   ;# The simple parser looks for &amp;lt;\% ... \%&amp;gt;&lt;br /&gt;
    ns_param   fancy           &amp;quot;.adp&amp;quot;   ;# The fancy parser does a lot more.&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Socket driver module (HTTP)  -- nssock&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nssock&amp;quot;&lt;br /&gt;
    ns_param   port            $httpport ;# Port for HTTP (typically 80)&lt;br /&gt;
    ns_param   hostname        $host     ;# This is not the same as your hostname&lt;br /&gt;
    ns_param   address         $address  ;# This is not the same as your host addr&lt;br /&gt;
    ns_param   location        &amp;quot;url&amp;quot;     ;# URL for auto-redirects (trailing slash)&lt;br /&gt;
    ns_param   maxinput        [expr 5 * 1024 * 1024]  ;# Maximum file size for uploads in bytes, default is 1MB, new in AOLserver 4.01&lt;br /&gt;
    ns_param   keepwait        30        ;# Max time conn is kept alive (keepalive)&lt;br /&gt;
                                         ;#   (set to 0 to disable keepalive)&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Socket driver module (HTTPS) -- nsssl&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nsssl&amp;quot;&lt;br /&gt;
    ns_param   port            $httpsport ;# Port for HTTPS (typically 443)&lt;br /&gt;
    ns_param   hostname        $host     ;# This is not the same as your hostname&lt;br /&gt;
    ns_param   address         $address  ;# This is not the same as your host addr&lt;br /&gt;
    ns_param   keyfile         ${home}/servers/${servername}/modules/nsssl/keyfile.pem&lt;br /&gt;
    ns_param   certfile        ${home}/servers/${servername}/modules/nsssl/certfile.pem&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Control port -- nscp&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nscp&amp;quot;&lt;br /&gt;
    ns_param   port            9999      ;# Control port listens on port 9999&lt;br /&gt;
    ns_param   address         &amp;quot;127.0.0.1&amp;quot; ;# For security, use 127.0.0.1 only&lt;br /&gt;
    &lt;br /&gt;
    # Control port users&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nscp/users&amp;quot;&lt;br /&gt;
    # The default password for nsadmin is &amp;quot;x&amp;quot;. You should change it.&lt;br /&gt;
    # type &amp;quot;ns_crypt newpassword salt&amp;quot; and put the encrypted string below.&lt;br /&gt;
    ns_param user &amp;quot;nsadmin:t2GqvvaiIUbF2:&amp;quot; ;# sample user=&amp;quot;nsadmin&amp;quot;, pw=&amp;quot;x&amp;quot;.&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Access log -- nslog&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nslog&amp;quot;&lt;br /&gt;
    ns_param   file            &amp;quot;access.log&amp;quot;&lt;br /&gt;
    ns_param   formattedtime   true      ;# true=common log format&lt;br /&gt;
    ns_param   logcombined     false     ;# true==NCSA combined format&lt;br /&gt;
    ns_param   maxbackup       5         ;# Max number to keep around when rolling&lt;br /&gt;
    ns_param   rollhour        0         ;# Time to roll log&lt;br /&gt;
    ns_param   rolllog         true      ;# Should we roll log?&lt;br /&gt;
    ns_param   rollonsignal    true      ;# Roll log on SIGHUP&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # CGI interface -- nscgi&lt;br /&gt;
    #&lt;br /&gt;
    # Note: CGI is *vastly* inferior to ADP's or even built-in Tcl libraries.&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nscgi&amp;quot;&lt;br /&gt;
    ns_param   debug           false     ;# Be chatty in log&lt;br /&gt;
    ns_param   gethostbyaddr   false     ;# Whether to do reverse DNS lookups&lt;br /&gt;
    ns_param   limit           0         ;# Max number of concurrent CGI processes&lt;br /&gt;
    ns_param   maxoutput       10240     ;# Max bytes allowed from external process&lt;br /&gt;
    ns_param   buffersize      8192      ;# Buffer output from external process&lt;br /&gt;
    ns_param   map  &amp;quot;GET /cgi /usr/local/cgi&amp;quot;        ;# Where your CGI executables live (GET)&lt;br /&gt;
    ns_param   map  &amp;quot;POST /cgi /usr/local/cgi&amp;quot;       ;# Where your CGI executables live (POST)&lt;br /&gt;
    &lt;br /&gt;
    # CGI environment variable handling -- See admin guide&lt;br /&gt;
    ns_param   systemenvironment false   ;# Copies environment from nsd start shell&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Access control (permissions) -- nsperm&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nsperm&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Unix domain socket driver -- nsunix&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nsunix&amp;quot;&lt;br /&gt;
    ns_param   hostname        &amp;quot;host&amp;quot;    ;# Hostname used in response to client&lt;br /&gt;
    ns_param   port            &amp;quot;port&amp;quot;    ;# Port to listen on&lt;br /&gt;
    ns_param   socketfile      &amp;quot;path.name&amp;quot; ;# UNIX domain socket driver&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Virtual Hosting redirector -- nsvhr&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nsvhr&amp;quot;&lt;br /&gt;
    ns_param   busyurl         &amp;quot;url&amp;quot;     ;# Redirect here if back-end times out&lt;br /&gt;
    ns_param   errorurl        &amp;quot;url&amp;quot;     ;# Redirect here on proxy errors&lt;br /&gt;
    ns_param   method          &amp;quot;GET&amp;quot;     ;# Methods allowed to proxy&lt;br /&gt;
    ns_param   method          &amp;quot;POST&amp;quot;    ;# Methods allowed to proxy (can have &amp;gt;1)&lt;br /&gt;
    ns_param   timeout         30        ;# Timeout waiting for back-end&lt;br /&gt;
    &lt;br /&gt;
    # Register hosts to proxy&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/module/nsvhr/maps&amp;quot;&lt;br /&gt;
    ns_param   &amp;quot;www.tcpsocket.com&amp;quot;    &amp;quot;http://127.0.0.0:2000&amp;quot; ;# HTTP proxy&lt;br /&gt;
    ns_param   &amp;quot;www.domainsocket.com&amp;quot; &amp;quot;unix://somehost&amp;quot;       ;# Domain socket&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Database drivers&lt;br /&gt;
    #&lt;br /&gt;
    # Two pools are given here.  Sybase uses the Sybase client libraries,&lt;br /&gt;
    # obtained from Sybase.  Postgres is freely available at&lt;br /&gt;
    # www.postgresql.org.  Sybase uses an external proxy daemon while&lt;br /&gt;
    # Postgres uses an internal driver.  The Sybase driver requires some&lt;br /&gt;
    # configuration in ns/db/driver/sybase_driver to tell th &amp;quot;nsext.so&amp;quot;&lt;br /&gt;
    # driver where to find the nssybpd executable and some other things.&lt;br /&gt;
    # The Postgres driver doesn't need any of that because it's internal&lt;br /&gt;
    # and does not use nsext.so.&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/db/drivers&amp;quot;&lt;br /&gt;
    ns_param   sybase_driver   nsext.so       ;# Use nsext.so for a proxy daemon&lt;br /&gt;
    ns_param   postgres_driver nspostgres.so  ;# An internal driver&lt;br /&gt;
    &lt;br /&gt;
    ns_section &amp;quot;ns/db/driver/sybase_driver&amp;quot;&lt;br /&gt;
    ns_param   localdaemon     nssybpd        ;# Name of the proxy daemon executable&lt;br /&gt;
    ns_param   param           path_to_sybase ;# Usually the $SYBASE env var&lt;br /&gt;
    &lt;br /&gt;
    ns_section &amp;quot;ns/db/pools&amp;quot;&lt;br /&gt;
    ns_param   sybase_pool    &amp;quot;Sybase Pool&amp;quot;&lt;br /&gt;
    ns_param   postgres_pool  &amp;quot;Postgres Pool&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    ns_section &amp;quot;ns/db/pool/sybase_pool&amp;quot;&lt;br /&gt;
    ns_param   driver          sybase_driver&lt;br /&gt;
    ns_param   datasource      SERVER_NAME:database_name&lt;br /&gt;
    ns_param   user            user_name&lt;br /&gt;
    ns_param   password        password&lt;br /&gt;
    ns_param   connections     1&lt;br /&gt;
    ns_param   logsqlerrors    true      ;# Verbose SQL query error logging&lt;br /&gt;
    ns_param   verbose         false     ;# Verbose error logging&lt;br /&gt;
    ns_param   maxidle         600       ;# Max time to keep idle db conn open&lt;br /&gt;
    ns_param   maxopen         3600      ;# Max time to keep active db conn open&lt;br /&gt;
    &lt;br /&gt;
    ns_section &amp;quot;ns/db/pool/postgres_pool&amp;quot;&lt;br /&gt;
    ns_param   driver          postgres_driver&lt;br /&gt;
    ns_param   datasource      HOSTNAME:PORT:database_name&lt;br /&gt;
    ns_param   user            user_name&lt;br /&gt;
    ns_param   password        password&lt;br /&gt;
    ns_param   connections     1&lt;br /&gt;
    ns_param   logsqlerrors    true      ;# Verbose SQL query error logging&lt;br /&gt;
    ns_param   verbose         false     ;# Verbose error logging&lt;br /&gt;
    ns_param   maxidle         600       ;# Max time to keep idle db conn open&lt;br /&gt;
    ns_param   maxopen         3600      ;# Max time to keep active db conn open&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Accessing DB pools&lt;br /&gt;
    #&lt;br /&gt;
    # In the case of virtual servers you can give different virtual&lt;br /&gt;
    # servers access to different databases, or you can let them access&lt;br /&gt;
    # them all.  AOLserver 3.x does not use virtual servers so the only&lt;br /&gt;
    # useful value is &amp;quot;*&amp;quot;, but if you use one config file for multiple nsd&lt;br /&gt;
    # processes, or you are using a version of AOLserver that supports&lt;br /&gt;
    # virtual servers, then you should list the pools you want to access.&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/db&amp;quot;&lt;br /&gt;
    ns_param pools          *            ;# Wildcard gives access to all&lt;br /&gt;
    ns_param defaultpool    sybase_pool&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Modules to load&lt;br /&gt;
    #&lt;br /&gt;
    # Note: Only load the modules you are actually going to use.&lt;br /&gt;
    #&lt;br /&gt;
    ns_section &amp;quot;ns/server/${servername}/modules&amp;quot;&lt;br /&gt;
    ns_param   nssock             nssock.so&lt;br /&gt;
    ns_param   nsssl              nsssle.so&lt;br /&gt;
    ns_param   nscp               nscp.so&lt;br /&gt;
    ns_param   nslog              nslog.so&lt;br /&gt;
    ns_param   nscgi              nscgi.so&lt;br /&gt;
    ns_param   nsperm             nsperm.so&lt;br /&gt;
    &lt;br /&gt;
    #&lt;br /&gt;
    # Loading a Tcl module&lt;br /&gt;
    #&lt;br /&gt;
    # This example shows a Tcl module, called &amp;quot;tcl_module&amp;quot;, has its code&lt;br /&gt;
    # in the AOLserver Tcl library in either the modules/tcl/tcl_module&lt;br /&gt;
    # directory or servers/servername/modules/tcl/tcl_module directory.&lt;br /&gt;
    #&lt;br /&gt;
    ns_param   tcl_module          tcl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Configuration]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Thread-shared_Variables&amp;diff=5317</id>
		<title>Thread-shared Variables</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Thread-shared_Variables&amp;diff=5317"/>
		<updated>2009-02-09T08:45:11Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: fix category entries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The nsv commands provide a high performance data sharing mechanism. This facility is a more flexible alternative to the obsolete [[ns_share]] command. The model uses an array syntax and includes more features. In addition, lock contention is managed in a much more scalable way--something that is not possible with the obsolete [[ns_share]] facility.&lt;br /&gt;
* [[nsv_get]] - get key value &lt;br /&gt;
* [[nsv_exists]] - check key existence &lt;br /&gt;
* [[nsv_set]] - set key value&lt;br /&gt;
* [[nsv_append]] - append value &lt;br /&gt;
* [[nsv_lappend]] - append value as list element &lt;br /&gt;
* [[nsv_incr]] - increment and return value &lt;br /&gt;
* [[nsv_unset]] - unset a value &lt;br /&gt;
* [[nsv_array]] - manage nsv arrays &lt;br /&gt;
* [[nsv_names]] - list the nsvs in use&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Commands for the most part mirror the corresponding Tcl command for ordinary variables. Basically, to set a value, simply use the nsv_set command:&lt;br /&gt;
&lt;br /&gt;
    nsv_set myarray foo $value&lt;br /&gt;
&lt;br /&gt;
and to get a value, simply use the nsv_get command:&lt;br /&gt;
&lt;br /&gt;
    set value [nsv_get myarray foo]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is the difference between nsv_set and nsv_array set? Is it exactly the same as the difference between set and array set?&lt;br /&gt;
&lt;br /&gt;
'''Multithreading Features'''&lt;br /&gt;
&lt;br /&gt;
One advantages of nsv is built in interlocking for thread safety. For example, consider a case of a &amp;quot;increment-by-one&amp;quot; unique id system. Here's the [[ns_share]] solution:&lt;br /&gt;
&lt;br /&gt;
    ns_share ids &lt;br /&gt;
    set ids(lock) [ns_mutex create]&lt;br /&gt;
    set ids(next) 0&lt;br /&gt;
&lt;br /&gt;
    proc nextid {} { &lt;br /&gt;
        ns_share ids &lt;br /&gt;
        ns_mutex lock $ids(lock) &lt;br /&gt;
        set next [incr ids(next)]&lt;br /&gt;
        ns_mutex unlock $ids(lock) &lt;br /&gt;
        return $next &lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
and here's an nsv solution:&lt;br /&gt;
&lt;br /&gt;
    nsv_set ids next 0&lt;br /&gt;
&lt;br /&gt;
    proc nextid {} { &lt;br /&gt;
        return [nsv_incr ids next]&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Note that the nsv solution does not need a mutex as the [[nsv_incr]] command is internally interlocked.&lt;br /&gt;
&lt;br /&gt;
'''Compatibility with Tcl Arrays'''&lt;br /&gt;
&lt;br /&gt;
Another useful feature of nsv is the [[nsv_array]] command which works much like the Tcl array command. This can be used to import and export values from ordinary Tcl arrays. For example, to copy from Tcl use:&lt;br /&gt;
&lt;br /&gt;
    nsv_array set meta [array get tmpmeta]&lt;br /&gt;
&lt;br /&gt;
and to copy to Tcl use:&lt;br /&gt;
&lt;br /&gt;
    array set metacopy [nsv_array get meta]&lt;br /&gt;
&lt;br /&gt;
As with all other nsv command, [[nsv_array]] is atomic and no explicit locking is required. This feature can be used to contruct a new nsv array by first filling up an ordinary temporary Tcl array via some time consuming process and then swapping it into place as above. While the new temporary array is being constructed, other threads can access the old array without delay or inconsistant data. You can even reset a complete nsv array in one step with &amp;quot;reset&amp;quot;. For example, instead of:&lt;br /&gt;
&lt;br /&gt;
    ns_share lock meta &lt;br /&gt;
    set lock [ns_mutex create]&lt;br /&gt;
&lt;br /&gt;
    ns_mutex lock $lock &lt;br /&gt;
    unset meta &lt;br /&gt;
    array set meta [array get tmpmeta]&lt;br /&gt;
    ns_mutex unlock $lock&lt;br /&gt;
&lt;br /&gt;
you can simply use:&lt;br /&gt;
&lt;br /&gt;
    nsv_array reset meta [array get tmpmeta]&lt;br /&gt;
&lt;br /&gt;
The reset option will flush and then reset all values atomically, eliminating the need for the explicit lock.&lt;br /&gt;
&lt;br /&gt;
Other options for the nsv_array command include:&lt;br /&gt;
* [[nsv_array]] exists ''array'' - test existance of array &lt;br /&gt;
* [[nsv_array]] size ''array'' - return # of elements in array &lt;br /&gt;
* [[nsv_array]] names ''array'' ''?pattern?'' - return keys of array&lt;br /&gt;
&lt;br /&gt;
'''Configuration'''&lt;br /&gt;
&lt;br /&gt;
The nsv system uses a common multithreading technique to reduce the potential for lock contention which is to split the locks to acheive finer grained locking. This technique groups arrays randomly into buckets and only the arrays within a particular bucket share a lock. The number of buckets to be used can be configured by setting the &amp;quot;nsvbuckets&amp;quot; tcl parameters, e.g.:&lt;br /&gt;
&lt;br /&gt;
    [[ns/server/server1/tcl]] &lt;br /&gt;
    nsvbuckets=20&lt;br /&gt;
&lt;br /&gt;
The default is 8 which should be reasonable. Note that you can monitor the lock contention, if any, by enabling mutex metering:&lt;br /&gt;
&lt;br /&gt;
    [[ns/threads]] &lt;br /&gt;
    mutexmetering=on&lt;br /&gt;
&lt;br /&gt;
and then viewing the results of &amp;quot;[[ns_info]] locks&amp;quot; command after the server has been running for some time. The nsv locks all have names of the form &amp;quot;nsv:##&amp;quot;. If you find many lock attempts which did not successed immediately, try increasing nsvbuckets.&lt;br /&gt;
&lt;br /&gt;
'''Migrating From ns_share'''&lt;br /&gt;
&lt;br /&gt;
Migrating from [[ns_share]] is straightforward. If your init.tcl included commands such as:&lt;br /&gt;
&lt;br /&gt;
    ns_share myshare &lt;br /&gt;
    set myshare(lock) [ns_mutex create]&lt;br /&gt;
&lt;br /&gt;
use instead:&lt;br /&gt;
&lt;br /&gt;
    nsv_set myshare lock [ns_mutex create]&lt;br /&gt;
&lt;br /&gt;
In your procedures, instead of:&lt;br /&gt;
&lt;br /&gt;
    proc myproc {} {&lt;br /&gt;
        ns_share myshare&lt;br /&gt;
        ns_mutex lock $myshare(lock)  ...&lt;br /&gt;
&lt;br /&gt;
use:&lt;br /&gt;
&lt;br /&gt;
    proc myproc {} { &lt;br /&gt;
        ns_mutex lock [nsv_get myshare lock]&lt;br /&gt;
        ...&lt;br /&gt;
&lt;br /&gt;
and within an ADP page, instead of:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% &lt;br /&gt;
        ns_share myshare &lt;br /&gt;
        ns_puts $myshare(key1)&lt;br /&gt;
    %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%=$myshare(key2)%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
use:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% &lt;br /&gt;
        ns_puts [nsv_get myshare key1]&lt;br /&gt;
    %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;%=[nsv_get myshare key2]%&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that, unlike [[ns_share]], no command is required to define the shared array. The first attempt at setting the variable through any means will automaticaly create the array. Also notice that only arrays are supported. However, to migrate from [[ns_share]] you can simply package up all existing [[ns_share]] scalars into a single array with a short name, perhaps just &amp;quot;.&amp;quot;. For example, if you had:&lt;br /&gt;
&lt;br /&gt;
    ns_share mylock myfile &lt;br /&gt;
    set myfile /tmp/some.file &lt;br /&gt;
    set mylock [ns_mutex create]&lt;br /&gt;
&lt;br /&gt;
you can use:&lt;br /&gt;
&lt;br /&gt;
    nsv_set . myfile /tmp/some.file &lt;br /&gt;
    nsv_set . mylock [ns_mutex create]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_buildsqldate&amp;diff=5314</id>
		<title>Ns buildsqldate</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_buildsqldate&amp;diff=5314"/>
		<updated>2009-02-07T20:04:11Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_buildsqldate.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_buildsqldate - Build a SQL date value from specified month, day, and year&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_buildsqldate''' ''month day year''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command builds a SQL date string out of the specified month, day, and year.  The month can be the month number (1 - 12) or the full, capitalized month name (January, February, ..., December).  The day must be a number from 1 - 31, and the year must be a 4-digit year (e.g., 1957).  An error is returned if any of the argument values are invalid.  The resulting string can be used in an SQL statement.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_buildsqldate &amp;quot;01&amp;quot; &amp;quot;15&amp;quot; &amp;quot;1929&amp;quot;&lt;br /&gt;
    1929-01-15&lt;br /&gt;
&lt;br /&gt;
    % ns_buildsqldate &amp;quot;13&amp;quot; &amp;quot;31&amp;quot; &amp;quot;2000&amp;quot;&lt;br /&gt;
    Invalid date: 13 31 2000&lt;br /&gt;
        while executing ...&lt;br /&gt;
&lt;br /&gt;
    % set thedate [[ns_buildsqldate &amp;quot;January&amp;quot; &amp;quot;15&amp;quot; &amp;quot;1929&amp;quot;]]&lt;br /&gt;
    % ns_db dml $db &amp;quot;INSERT INTO mytable (datefield) VALUES ([[ns_dbquotevalue $thedate]])&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_buildsqltime]], [[ns_buildsqltimestamp]], [[ns_parsesqldate]], [[ns_parsesqltime]], [[ns_parsesqltimestamp]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_localsqltimestamp&amp;diff=5313</id>
		<title>Ns localsqltimestamp</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_localsqltimestamp&amp;diff=5313"/>
		<updated>2009-02-07T20:03:37Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_localsqltimestamp.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_localsqltimestamp - Return a SQL timestamp containing the local time.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_localsqltimestamp'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command returns a timestamp value that encodes the local time in ANSI SQL format (YYYY-MM-DD hh24:mm:ss).&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_localsqltimestamp&lt;br /&gt;
    2004-06-22 23:00:27&lt;br /&gt;
&lt;br /&gt;
: This command is equivalent to the following:&lt;br /&gt;
&lt;br /&gt;
    % ns_fmttime [[ns_time]] &amp;quot;%Y-%m-%d %H:%M:%S&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    % clock format [[ns_time]] -format &amp;quot;%Y-%m-%d %H:%M:%S&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_localtime]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_dbquotevalue&amp;diff=5312</id>
		<title>Ns dbquotevalue</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_dbquotevalue&amp;diff=5312"/>
		<updated>2009-02-07T20:02:56Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_dbquotevalue.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_dbquotevalue - Prepare a value string for inclusion in an SQL statement.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_dbquotevalue''' ''value ?type?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command prepares the string ''value'' for inclusion in an SQL statement.  If ''value'' is &amp;quot;&amp;quot;, ns_dbquotevalue will return the string &amp;quot;NULL&amp;quot;.  If ''value'' is not &amp;quot;&amp;quot;, the returned value depends on ''type''.  If ''type'' is one of: bigint, bit, decimal, double, float, int, integer, numeric, real, smallint, or tinyint, then ''value'' will be returned without modification.  When ''type'' is any other string, or if ''type'' is omitted, ''value'' will be surrounded by single quotes, and any single quotes that it contains will be escaped by translation into two single quotes.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_dbquotevalue &amp;quot;&amp;quot;&lt;br /&gt;
    NULL&lt;br /&gt;
&lt;br /&gt;
    % ns_dbquotevalue 45.3 float&lt;br /&gt;
    45.3&lt;br /&gt;
&lt;br /&gt;
    % ns_dbquotevalue &amp;quot;John's Car&amp;quot;&lt;br /&gt;
    &amp;lt;nowiki&amp;gt;'John''s Car'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    % set company &amp;quot;John's Cheese Factory&amp;quot;&lt;br /&gt;
    % ns_db dml $db &amp;quot;INSERT INTO companies (name) VALUES ([ns_dbquotevalue $company])&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_dbquotename]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_db&amp;diff=5311</id>
		<title>Ns db</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_db&amp;diff=5311"/>
		<updated>2009-02-07T20:02:13Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_db.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_db - Standard database access API.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_db''' ''option ?arg arg ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
This command provides a mechanism to access databases.  The legal ''option''s (which may be abbreviated) are:&lt;br /&gt;
* '''ns_db bindrow''' ''dbhandle''&lt;br /&gt;
* '''ns_db bouncepool''' ''poolname''&lt;br /&gt;
&lt;br /&gt;
: Marks all database handles for the specified database pool as stale. When any database handle currently open is put back into the pool, its connection to the database will be reset.&lt;br /&gt;
* '''ns_db cancel''' ''dbhandle''&lt;br /&gt;
* '''ns_db close''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Closes the connection. Use this function only on handles that were obtained by the '''ns_db open''' function.  The server automatically close handles when the operation is complete, so you don't normally have to call this function.&lt;br /&gt;
* '''ns_db connected''' ''dbhandle''&lt;br /&gt;
* '''ns_db datasource''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Returns the datasource for the database pool.&lt;br /&gt;
* '''ns_db dbtype''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Returns the database type for the database pool.&lt;br /&gt;
* '''ns_db dml''' ''dbhandle sql''&lt;br /&gt;
* '''ns_db driver''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Returns the name of the driver of the handle.&lt;br /&gt;
* '''ns_db exception''' ''dbhandle''&lt;br /&gt;
* '''ns_db exec''' ''dbhandle sqlcommand''&lt;br /&gt;
&lt;br /&gt;
: Executes the specified SQL command. It returns either NS_DML (if the SQL command is a DML or DDL command) or NS_ROWS (if the SQL command returns rows, such as a SELECT).  This function can be used for ad hoc querying, where you don't know what kind of SQL command will be executed.  &lt;br /&gt;
* '''ns_db flush''' ''dbhandle''&lt;br /&gt;
* '''ns_db gethandle''' ''?-timeout timeout? poolname ?nhandles?''&lt;br /&gt;
* '''ns_db getrow''' ''dbhandle setId''&lt;br /&gt;
* '''ns_db open''' ''driver datasource user password''&lt;br /&gt;
* '''ns_db poolname''' ''dbhandle''&lt;br /&gt;
* '''ns_db pools'''&lt;br /&gt;
* '''ns_db releasehandle''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Puts the handle back in the pool.  The server will automatically return any open handles to the pool after a page has finished executing.&lt;br /&gt;
* '''ns_db 1row''' ''dbhandle sql''&lt;br /&gt;
&lt;br /&gt;
: This command expects the SQL to be a select statement that returns exactly one row and returns that row as an ns_set.  An error is returned if zero or more than one row is returned.&lt;br /&gt;
* '''ns_db 0or1row''' ''dbhandle sql''&lt;br /&gt;
&lt;br /&gt;
: This command expects the SQL to be a select statement that returns exactly zero or one row. On zero rows, a null string is returned. On one row, a newly allocated ns_set is returned.  An error is thrown if more then one row is returned.&lt;br /&gt;
* '''ns_db password''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Returns the password of the user for the database pool.&lt;br /&gt;
* '''ns_db select''' ''dbhandle sql''&lt;br /&gt;
* '''ns_db setexception''' ''dbhandle code message''&lt;br /&gt;
* '''ns_db sp_exec''' ''dbhandle''&lt;br /&gt;
* '''ns_db sp_getparams'''&lt;br /&gt;
* '''ns_db sp_returncode''' ''dbhandle''&lt;br /&gt;
* '''ns_db sp_setparam''' ''dbhandle varname vartype inout value''&lt;br /&gt;
* '''ns_db sp_start''' ''dbhandle procname''&lt;br /&gt;
* '''ns_db user''' ''dbhandle''&lt;br /&gt;
&lt;br /&gt;
: Returns the user for the database pool.&lt;br /&gt;
* '''ns_db verbose''' ''dbhandle ?on | off?''&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_buildsqldate]], [[ns_buildsqltime]], [[ns_buildsqltimestamp]], [[ns_dbquotename]], [[ns_dbquotevalue]], [[ns_localsqltimestamp]], [[ns_parsesqldate]], [[ns_parsesqltime]], [[ns_parsesqltimestamp]], [[ns_writecsv]]&lt;br /&gt;
&lt;br /&gt;
: The tutorial [[Accessing A Database]] shows some very simple '''ns_db''' usage&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_guesstype&amp;diff=5310</id>
		<title>Ns guesstype</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_guesstype&amp;diff=5310"/>
		<updated>2009-02-07T20:00:22Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_guesstype.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_guesstype - Lookup MIME type based on file extension.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_guesstype''' ''filename''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command guesses and returns the MIME type of a file, based on the extension of ''filename''.  A large set of default extension to MIME type mappings is built into the command:&lt;br /&gt;
* .adp    returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .dci    returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .htm    returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .html   returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .sht    returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .shtml  returns &amp;quot;text/html; charset=iso-8859-1&amp;quot;&lt;br /&gt;
* .ai     returns &amp;quot;application/postscript&amp;quot;&lt;br /&gt;
* .aif    returns &amp;quot;audio/aiff&amp;quot;&lt;br /&gt;
* .aifc   returns &amp;quot;audio/aiff&amp;quot;&lt;br /&gt;
* .aiff   returns &amp;quot;audio/aiff&amp;quot;&lt;br /&gt;
* .ani    returns &amp;quot;application/x-navi-animation&amp;quot;&lt;br /&gt;
* .art    returns &amp;quot;image/x-art&amp;quot;&lt;br /&gt;
* .au     returns &amp;quot;audio/basic&amp;quot;&lt;br /&gt;
* .avi    returns &amp;quot;video/x-msvideo&amp;quot;&lt;br /&gt;
* .bin    returns &amp;quot;application/x-macbinary&amp;quot;&lt;br /&gt;
* .bmp    returns &amp;quot;image/bmp&amp;quot;&lt;br /&gt;
* .css    returns &amp;quot;text/css&amp;quot;&lt;br /&gt;
* .csv    returns &amp;quot;application/csv&amp;quot;&lt;br /&gt;
* .dcr    returns &amp;quot;application/x-director&amp;quot;&lt;br /&gt;
* .dir    returns &amp;quot;application/x-director&amp;quot;&lt;br /&gt;
* .dp     returns &amp;quot;application/commonground&amp;quot;&lt;br /&gt;
* .dxr    returns &amp;quot;application/x-director&amp;quot;&lt;br /&gt;
* .elm    returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .eml    returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .exe    returns &amp;quot;application/octet-stream&amp;quot;&lt;br /&gt;
* .gbt    returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .gif    returns &amp;quot;image/gif&amp;quot;&lt;br /&gt;
* .gz     returns &amp;quot;application/x-compressed&amp;quot;&lt;br /&gt;
* .hqx    returns &amp;quot;application/mac-binhex40&amp;quot;&lt;br /&gt;
* .jfif   returns &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
* .jpe    returns &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
* .jpg    returns &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
* .jpeg   returns &amp;quot;image/jpeg&amp;quot;&lt;br /&gt;
* .js     returns &amp;quot;application/x-javascript&amp;quot;&lt;br /&gt;
* .ls     returns &amp;quot;application/x-javascript&amp;quot;&lt;br /&gt;
* .map    returns &amp;quot;application/x-navimap&amp;quot;&lt;br /&gt;
* .mid    returns &amp;quot;audio/x-midi&amp;quot;&lt;br /&gt;
* .midi   returns &amp;quot;audio/x-midi&amp;quot;&lt;br /&gt;
* .mocha  returns &amp;quot;application/x-javascript&amp;quot;&lt;br /&gt;
* .mov    returns &amp;quot;video/quicktime&amp;quot;&lt;br /&gt;
* .mpe    returns &amp;quot;video/mpeg&amp;quot;&lt;br /&gt;
* .mpeg   returns &amp;quot;video/mpeg&amp;quot;&lt;br /&gt;
* .mpg    returns &amp;quot;video/mpeg&amp;quot;&lt;br /&gt;
* .nvd    returns &amp;quot;application/x-navidoc&amp;quot;&lt;br /&gt;
* .nvm    returns &amp;quot;application/x-navimap&amp;quot;&lt;br /&gt;
* .pbm    returns &amp;quot;image/x-portable-bitmap&amp;quot;&lt;br /&gt;
* .pdf    returns &amp;quot;application/pdf&amp;quot;&lt;br /&gt;
* .pgm    returns &amp;quot;image/x-portable-graymap&amp;quot;&lt;br /&gt;
* .pic    returns &amp;quot;image/pict&amp;quot;&lt;br /&gt;
* .pict   returns &amp;quot;image/pict&amp;quot;&lt;br /&gt;
* .pnm    returns &amp;quot;image/x-portable-anymap&amp;quot;&lt;br /&gt;
* .png    returns &amp;quot;image/png&amp;quot;&lt;br /&gt;
* .ps     returns &amp;quot;application/postscript&amp;quot;&lt;br /&gt;
* .qt     returns &amp;quot;video/quicktime&amp;quot;&lt;br /&gt;
* .ra     returns &amp;quot;audio/x-pn-realaudio&amp;quot;&lt;br /&gt;
* .ram    returns &amp;quot;audio/x-pn-realaudio&amp;quot;&lt;br /&gt;
* .ras    returns &amp;quot;image/x-cmu-raster&amp;quot;&lt;br /&gt;
* .rgb    returns &amp;quot;image/x-rgb&amp;quot;&lt;br /&gt;
* .rtf    returns &amp;quot;application/rtf&amp;quot;&lt;br /&gt;
* .sit    returns &amp;quot;application/x-stuffit&amp;quot;&lt;br /&gt;
* .snd    returns &amp;quot;audio/basic&amp;quot;&lt;br /&gt;
* .sql    returns &amp;quot;application/x-sql&amp;quot;&lt;br /&gt;
* .stl    returns &amp;quot;application/x-navistyle&amp;quot;&lt;br /&gt;
* .tar    returns &amp;quot;application/x-tar&amp;quot;&lt;br /&gt;
* .tcl    returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .text   returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .tgz    returns &amp;quot;application/x-compressed&amp;quot;&lt;br /&gt;
* .tif    returns &amp;quot;image/tiff&amp;quot;&lt;br /&gt;
* .tiff   returns &amp;quot;image/tiff&amp;quot;&lt;br /&gt;
* .txt    returns &amp;quot;text/plain&amp;quot;&lt;br /&gt;
* .xbm    returns &amp;quot;image/x-xbitmap&amp;quot;&lt;br /&gt;
* .xpm    returns &amp;quot;image/x-xpixmap&amp;quot;&lt;br /&gt;
* .xht    returns &amp;quot;application/xhtml+xml&amp;quot;&lt;br /&gt;
* .xhtml  returns &amp;quot;application/xhtml+xml&amp;quot;&lt;br /&gt;
* .xml    returns &amp;quot;text/xml&amp;quot;&lt;br /&gt;
* .xsl    returns &amp;quot;text/xml&amp;quot;&lt;br /&gt;
* .vrml   returns &amp;quot;x-world/x-vrml&amp;quot;&lt;br /&gt;
* .wav    returns &amp;quot;audio/x-wav&amp;quot;&lt;br /&gt;
* .wrl    returns &amp;quot;x-world/x-vrml&amp;quot;&lt;br /&gt;
* .z      returns &amp;quot;application/x-compressed&amp;quot;&lt;br /&gt;
* .zip    returns &amp;quot;application/x-zip-compressed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: The MIME type returned for an extension can be overriden in the AOLserver config file, and new mappings can be added, e.g.&lt;br /&gt;
&lt;br /&gt;
    ns_section &amp;quot;ns/mimetypes&amp;quot;&lt;br /&gt;
    ns_param  &amp;quot;.xls&amp;quot;        &amp;quot;application/vnd.ms-excel&amp;quot;      ;# Add a mapping for Excel files&lt;br /&gt;
    ns_param  &amp;quot;.sjis_html&amp;quot;  &amp;quot;text/html; charset=shift_jis&amp;quot;  ;# Adding a mapping, specifing charset&lt;br /&gt;
    ns_param  &amp;quot;.adp&amp;quot;        &amp;quot;text/html; charset=UTF-8&amp;quot;      ;# Overriding an existing mapping&lt;br /&gt;
&lt;br /&gt;
: The MIME type to be returned for files with unrecognized or missing extensions can also be specified in the &amp;quot;ns/mimetypes&amp;quot; section of the config file, e.g.&lt;br /&gt;
&lt;br /&gt;
    ns_section &amp;quot;ns/mimetypes&amp;quot;&lt;br /&gt;
    ns_param  default      &amp;quot;*/*&amp;quot;  ;# MIME type for unrecognized extension.&lt;br /&gt;
    ns_param  noextension  &amp;quot;*/*&amp;quot;  ;# MIME type for missing extension.&lt;br /&gt;
&lt;br /&gt;
: If default is not configured, &amp;quot;*/*&amp;quot; will be returned for files with unrecognized extensions.  If noextension is not configured, the MIME type configured as default (or &amp;quot;*/*&amp;quot;) will be used.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
: (Assuming configured with the examples above)&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype &amp;quot;hello.jpg&amp;quot;&lt;br /&gt;
    image/jpeg&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype &amp;quot;hello.xls&amp;quot;&lt;br /&gt;
    application/vnd.ms-excel&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype &amp;quot;hello.html&amp;quot;&lt;br /&gt;
    text/html; charset=iso-8859-1&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype &amp;quot;world.adp&amp;quot;&lt;br /&gt;
    text/html; charset=UTF-8&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype &amp;quot;world.doc&amp;quot;&lt;br /&gt;
*/*&lt;br /&gt;
&lt;br /&gt;
    % ns_guesstype somefile&lt;br /&gt;
*/*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsequery&amp;diff=5309</id>
		<title>Ns parsequery</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsequery&amp;diff=5309"/>
		<updated>2009-02-07T19:58:31Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_parsequery.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_parsequery - Parse a URL query string into an ns_set.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_parsequery''' ''querystring''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command parses the specified ''querystring'' into an [[ns_set]], which is returned.  The keys and values will be decoded.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set s [ns_parsequery &amp;quot;msg=Hello+World%21&amp;amp;a=b&amp;amp;a=b&amp;amp;c=d&amp;quot;]&lt;br /&gt;
    d0&lt;br /&gt;
&lt;br /&gt;
    % ns_set array $s&lt;br /&gt;
    msg {Hello World!} a b a b c d&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_register_adp&amp;diff=5308</id>
		<title>Ns register adp</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_register_adp&amp;diff=5308"/>
		<updated>2009-02-07T19:57:33Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Similar to Registered Procedures, all requests to a particular URL &lt;br /&gt;
can be captured but in this situation processing can be performed &lt;br /&gt;
by an ADP file. Giving additional functionality of being able to make &lt;br /&gt;
changes a lot more rapidly. &lt;br /&gt;
&lt;br /&gt;
This also provides a method of making view controls at ADP level &lt;br /&gt;
rather than at TCL level, which keeps development at an &lt;br /&gt;
appropriate abstracted level.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
&lt;br /&gt;
 ns_register_adp GET|POST /URL/* FILE&lt;br /&gt;
&lt;br /&gt;
Both registered ADP pages, and registered procedures will be called&lt;br /&gt;
irregardless of to original requested target existing or not.&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_rand&amp;diff=5307</id>
		<title>Ns rand</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_rand&amp;diff=5307"/>
		<updated>2009-02-07T19:56:26Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_rand.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_rand - Generate a random number&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_rand''' ''?maximum?'' &lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command generates a cryptographically secure random number.  If ''maximum'' is not specified, the random number returned is a floating-point value n such that 0.0 &amp;lt;= n &amp;lt; 1.0.  If ''maximum'' is specified, it must be a positive integer between 1 and 2147483647, in which case '''ns_rand''' will return an integer value n such that 0 &amp;lt;= n &amp;lt;= max - 1.&lt;br /&gt;
&lt;br /&gt;
: Internally '''ns_rand''' is implemented with the '''drand48()''' and '''lrand48()''' standard library functions.  An internal random seed is generated the first time '''ns_rand''' is called after the server starts.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_rand&lt;br /&gt;
    0.39938485692&lt;br /&gt;
&lt;br /&gt;
    % ns_rand 10&lt;br /&gt;
    7&lt;br /&gt;
&lt;br /&gt;
'''CAVEAT'''&lt;br /&gt;
&lt;br /&gt;
: [ns_rand 1] will always produce the result 0. [ns_rand 2] will produce the desired &amp;quot;coin flip&amp;quot; outcome of 0 or 1. This is standard with [http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html#nextInt(int) Java's java.util.Random implementation of nextInt] and most other random number libraries.&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_adp_registerscript&amp;diff=5306</id>
		<title>Ns adp registerscript</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_adp_registerscript&amp;diff=5306"/>
		<updated>2009-02-07T19:55:48Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/devel/tcl/api/adp.html#ns_register_adptag&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_register_adptag - Register an XML-like tag for use within an ADP.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_register_adptag''' command ''?endcommand?'' proc&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_register_adptag''' registers a procedure to be called when the specified beginning and ending tags are used in an ADP. The command is the beginning tag to look for, and the ''endcommand'' is the ending tag to look for. The proc is the procedure that will be called when AOLserver encounters those tags when processing an ADP.&lt;br /&gt;
&lt;br /&gt;
: Try not to confuse '''ns_register_adptag''' with [[ns_adp_registertag]]. This one registers a Tcl proc that is run by the tag. The other one registers an ADP script that is run by the tag.&lt;br /&gt;
&lt;br /&gt;
: There are two ways to use '''ns_register_adptag''', with and without the ''endcommand'' parameter:&lt;br /&gt;
&lt;br /&gt;
* If the endcommand parameter is specified, the procedure you specify with proc must be of the form:&lt;br /&gt;
&lt;br /&gt;
    proc myadpproc { string tagset }&lt;br /&gt;
&lt;br /&gt;
: The string is the string of characters between the beginning tag and the ending tag. The tagset is an [[ns_set]] of parameters that were specified with the beginning tag. The return value of the procedure will be sent to the browser in place of the string of text that was specified between the beginning and ending tags.&lt;br /&gt;
&lt;br /&gt;
: The string is not parsed, which means that you cannot include ADP tags in the string unless you execute [[ns_adp_parse]] on the string inside the procedure that processes the registered ADP tag.&lt;br /&gt;
&lt;br /&gt;
* If ''endcommand'' is not specified, then no closing tag is required. The procedure (proc) will be called every time the specified command is encountered. The procedure should take one parameter, an [[ns_set]] containing the parameters to the tag:&lt;br /&gt;
&lt;br /&gt;
    proc myadpproc { tagset }&lt;br /&gt;
&lt;br /&gt;
: Note: This function cannot be called after the server has started. It must be called in a Tcl script in a virtual server's Tcl directory so that it can be initialized at server startup time.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLE'''&lt;br /&gt;
&lt;br /&gt;
: Suppose you want to register a tag that displays the enclosed text only if it is Christmas. You could register the tag as follows:&lt;br /&gt;
&lt;br /&gt;
    ns_register_adptag &amp;quot;christmas&amp;quot; &amp;quot;/christmas&amp;quot; xmas&lt;br /&gt;
&lt;br /&gt;
    # Note: We are registering a Tcl proc.&lt;br /&gt;
    proc xmas {string tagset} {&lt;br /&gt;
        if {[ns_fmttime [ns_time] &amp;quot;%m/%d&amp;quot;] == &amp;quot;12/25&amp;quot;}  then {&lt;br /&gt;
            return $string&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
: Then, in an ADP, you use these tags:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;christmas&amp;gt;Merry Christmas to all, and to all a good night!&amp;lt;/christmas&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: In another example we show how to use a registered tag without an ''endcommand''. The tag is registered as follows:&lt;br /&gt;
&lt;br /&gt;
    ns_register_adptag hello helloproc&lt;br /&gt;
&lt;br /&gt;
    # Note: We are registering a Tcl proc.&lt;br /&gt;
    proc helloproc { tags } {&lt;br /&gt;
        return &amp;quot;Hello, [ns_set get $tags name].&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
: In an ADP, you use this tag:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;hello name=Bob&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: This can be extended to provide XML-like template pages for content.&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_adp_registertag]], [[ns_adp_parse]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_register_proc&amp;diff=5305</id>
		<title>Ns register proc</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_register_proc&amp;diff=5305"/>
		<updated>2009-02-07T19:54:49Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{manpage|ns_proc}}&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_register_proc - Register a procedure for a method/URL combination&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_register_proc''' ''?-noinherit? method URL myproc ?args?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_register_proc''' registers the procname to handle the specified method/URL combination.  When the server gets a matching request, it calls procname with the connection id and any arguments specified here.&lt;br /&gt;
&lt;br /&gt;
: If ''-noinherit'' is specified, the requested URL must match the specified URL exactly.  For example, if the URL specified with '''ns_register_proc''' is /foo/bar, procname will not be called unless the requested URL is exactly /foo/bar.&lt;br /&gt;
&lt;br /&gt;
: If ''-noinherit'' is not specified, the requested URL can match the specified URL or any URL below it.  For example, if the URL specified with '''ns_register_proc''' is /foo/bar, procname will be called for /foo/bar, /foo/bar/hmm, and any other URL below /foo/bar, provided there is not already another procedure registered for that exact URL or for an URL with a closer match.&lt;br /&gt;
&lt;br /&gt;
: Note that you must use a glob-style matching character if you want inheritance for file names.  For example, if you want /foo/bar to match /foo/bar.html, you must use: &lt;br /&gt;
&lt;br /&gt;
    ns_register_proc /foo/bar*&lt;br /&gt;
&lt;br /&gt;
: You can register two procedures for any given method/URL combination by calling '''ns_register_proc''' once with the ''-noinherit'' flag set and once without it.  Only one of the procedures will be called for any given request, depending on whether the URL was an exact match or not.  For example:&lt;br /&gt;
&lt;br /&gt;
    ns_register_proc -noinherit GET /foo/bar Aproc&lt;br /&gt;
    ns_register_proc GET /foo/bar Bproc&lt;br /&gt;
    ns_register_proc GET /foo/bar/hmm Cproc&lt;br /&gt;
&lt;br /&gt;
: Aproc will be called when the requested URL is exactly /foo/bar.  Bproc will be called when the requested URL is below /foo/bar, provided there is not already another procedure registered to be called for that exact URL or for an URL with a closer match.  Cproc (not Bproc) will be called when the requested URL is equal to or below /foo/bar/hmm.  Syntax for the registered procedure The conn (connection) argument is optional for procedures registered by '''ns_register_proc''' if the procedure has 0 or 1 arguments (not including conn).  The following examples show the variations that can be used in this case:&lt;br /&gt;
&lt;br /&gt;
    ns_register_proc GET /noargs noargs&lt;br /&gt;
    ns_register_proc GET /context context fnord&lt;br /&gt;
    ns_register_proc GET /conncontext conncontext greeblev&lt;br /&gt;
    &lt;br /&gt;
    proc noargs { } {&lt;br /&gt;
        ns_returnnotice 200 &amp;quot;noargs&amp;quot;&lt;br /&gt;
    } ;# noargs&lt;br /&gt;
    &lt;br /&gt;
    proc context { context } {&lt;br /&gt;
        ns_returnnotice 200 &amp;quot;context is $context&amp;quot;&lt;br /&gt;
    } ;# context&lt;br /&gt;
    &lt;br /&gt;
    proc conncontext { conn context } {&lt;br /&gt;
        ns_returnnotice 200 &amp;quot;conncontext is $context&amp;quot;&lt;br /&gt;
    } ;# conncontext&lt;br /&gt;
&lt;br /&gt;
: The ''conn'' (connection) argument is required for procedures registered by '''ns_register_proc''' if the procedure has 2 or more arguments (not including ''conn'').  The ''conn'' argument will be filled automatically with the connection information.  The first argument following ''conn'' will always take the value supplied by '''ns_register_proc''', if there is one, or an empty value.  All other arguments must supply a default value.  The following examples show the variations that can be used in this case:&lt;br /&gt;
&lt;br /&gt;
    ns_register_proc GET /twoargs twoargs fnord&lt;br /&gt;
    ns_register_proc GET /threeargs threeargs fnord fjord&lt;br /&gt;
    &lt;br /&gt;
    proc twoargs { conn context { greeble bork } } {&lt;br /&gt;
        # Do stuff...&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    proc threeargs { conn context {greeble bork } { hoover quark } {&lt;br /&gt;
        # Do stuff...&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
: When a GET of /twoargs is requested, the conn argument will be filled automatically, the context argument will be assigned &amp;quot;fnord&amp;quot; and the greeble argument will be assigned the default value &amp;quot;bork&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
: When a GET of /threeargs is requested, the conn argument will be filled automatically, the context argument will be assigned &amp;quot;fnord&amp;quot; and the greeble argument will be assigned &amp;quot;fjord&amp;quot;, and the hoover argument will be assigned the default value &amp;quot;quark&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_unregister_proc]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_shutdown&amp;diff=5304</id>
		<title>Ns shutdown</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_shutdown&amp;diff=5304"/>
		<updated>2009-02-07T19:54:15Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_shutdown.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_shutdown - Shut down AOLserver&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_shutdown''' ''?timeout?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command shuts down the currently running instance of AOLserver, by sending an NS_SIGTERM signal.[[User:Gustafn|Gustafn]]If ''timeout'' is specified, the server waits that many seconds to shutdown; otherwise it shuts down immediately.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    ns_shutdown&lt;br /&gt;
    ns_shutdown 30&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: none&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_section&amp;diff=5303</id>
		<title>Ns section</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_section&amp;diff=5303"/>
		<updated>2009-02-07T19:52:56Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_section.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_section - Specify the current configuration section.&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_section''' ''sectionname''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command sets the current section to define parameters for using [[ns_param]].  This command is only available at server startup when parsing the config .tcl file.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_section &amp;quot;ns/server/$servername/section&amp;quot;&lt;br /&gt;
    % ns_param someSetting someValue&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_config]], [[ns_configsection]], [[ns_configsections]], [[ns_param]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_modulepath&amp;diff=5302</id>
		<title>Ns modulepath</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_modulepath&amp;diff=5302"/>
		<updated>2009-02-07T19:52:15Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_modulepath.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_modulepath - Get the paths to a server's modules&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_modulepath''' ''server ?module ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
: This command returns the path to a server's directory and optionally to its modules.  The command does no validation on the ''server'' to see if it is actually defined.&lt;br /&gt;
&lt;br /&gt;
: The server directory is a subdirectory of &amp;quot;servers&amp;quot; under the path returned from [[ns_info]] '''home'''.  Modules are relative to that directory in the subdirectory &amp;quot;modules&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_modulepath exampleServer&lt;br /&gt;
    /home/aolserver/servers/exampleServer&lt;br /&gt;
&lt;br /&gt;
    % file join [[ns_info home]] servers exampleServer&lt;br /&gt;
    /home/aolserver/servers/exampleServer&lt;br /&gt;
&lt;br /&gt;
    % ns_modulepath exampleServer exampleModule&lt;br /&gt;
    /home/aolserver/servers/exampleServer/modules/exampleModule&lt;br /&gt;
&lt;br /&gt;
    % file join [[ns_info home]] servers exampleServer modules exampleModule&lt;br /&gt;
    /home/aolserver/servers/exampleServer/modules/exampleModule&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_info]] '''home'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_library&amp;diff=5301</id>
		<title>Ns library</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_library&amp;diff=5301"/>
		<updated>2009-02-07T19:51:33Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_library.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_library - Get the paths to the private and shared Tcl libraries&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_library''' ''library ?module?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
: This command returns the path to the private and shared Tcl libraries, optionally specifying a ''module'' as well.&lt;br /&gt;
''library'' must either be &amp;quot;private&amp;quot; or &amp;quot;shared&amp;quot;.  The private library is the same as what's returned from [[ns_info]] '''tcllib''' as defined in the config .tcl at server start-up.  The shared library is relative to the path specified by [[ns_info]] '''home''', in the &amp;quot;modules/tcl&amp;quot; subdirectory.&lt;br /&gt;
&lt;br /&gt;
: The optional ''module'' is simply concatenated to the path returned from '''ns_library'''.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_library shared&lt;br /&gt;
    /home/aolserver/modules/tcl&lt;br /&gt;
&lt;br /&gt;
    % file join [ns_info home] modules tcl&lt;br /&gt;
    /home/aolserver/modules/tcl&lt;br /&gt;
&lt;br /&gt;
    % ns_library private exampleModule&lt;br /&gt;
    /home/aolserver/servers/exampleServer/tcl/exampleModule&lt;br /&gt;
&lt;br /&gt;
    % file join [ns_info tcllib] exampleModule&lt;br /&gt;
    /home/aolserver/servers/exampleServer/tcl/exampleModule&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_info]] '''home''', [[ns_info]] '''tcllib'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsection&amp;diff=5300</id>
		<title>Ns configsection</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsection&amp;diff=5300"/>
		<updated>2009-02-07T19:50:16Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;manpage&amp;gt;ns_configsection&amp;lt;/manpage&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsection - Return a handle to an [[ns_set]] for a section of the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsection''' ''section''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a handle for an [[ns_set]] which contains all the parameter key-value pairs for the ''section'' from the server's configuration.  If the ''section'' is not defined, this command returns an empty string.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set setId [ns_configsection ns/parameters]&lt;br /&gt;
  t0&lt;br /&gt;
&lt;br /&gt;
  % ns_set name $setId&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
  % array set a [ns_set array $setId]&lt;br /&gt;
  % array names a&lt;br /&gt;
  EnableAdmin MailHost Home Group User debug&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsections]], [[ns_set]]&lt;br /&gt;
----&lt;br /&gt;
[[Category:Documentation]] [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5299</id>
		<title>Ns configsections</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5299"/>
		<updated>2009-02-07T19:49:47Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_configsections.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsections - Return a list of handles to [[ns_set]]s for every section in the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsections'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a list of [[ns_set]]s for every section in the server's configuration.  The corresponding [[ns_set]]s contain the key-value pairs for the configuration section that the [[ns_set]] represents.  &lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set sections [[ns_configsections]]&lt;br /&gt;
  t0 t1 t2 t3 ... t116 t117&lt;br /&gt;
&lt;br /&gt;
  % ns_set name t8&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsection]], [[ns_set]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Documentation]]  [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5298</id>
		<title>Ns configsections</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5298"/>
		<updated>2009-02-07T19:49:29Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_configsections.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsections - Return a list of handles to [[ns_set]]s for every section in the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsections'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a list of [[ns_set]]s for every section in the server's configuration.  The corresponding [[ns_set]]s contain the key-value pairs for the configuration section that the [[ns_set]] represents.  &lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set sections [[ns_configsections]]&lt;br /&gt;
  t0 t1 t2 t3 ... t116 t117&lt;br /&gt;
&lt;br /&gt;
  % ns_set name t8&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsection]], [[ns_set]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5297</id>
		<title>Ns configsections</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5297"/>
		<updated>2009-02-07T19:49:09Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_configsections.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsections - Return a list of handles to [[ns_set]]s for every section in the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsections'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a list of [[ns_set]]s for every section in the server's configuration.  The corresponding [[ns_set]]s contain the key-value pairs for the configuration section that the [[ns_set]] represents.  &lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set sections [[ns_configsections]]&lt;br /&gt;
  t0 t1 t2 t3 ... t116 t117&lt;br /&gt;
&lt;br /&gt;
  % ns_set name t8&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsection]], [[ns_set]]&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5296</id>
		<title>Ns configsections</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsections&amp;diff=5296"/>
		<updated>2009-02-07T19:48:54Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_configsections.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsections - Return a list of handles to [[ns_set]]s for every section in the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsections'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a list of [[ns_set]]s for every section in the server's configuration.  The corresponding [[ns_set]]s contain the key-value pairs for the configuration section that the [[ns_set]] represents.  &lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set sections [[ns_configsections]]&lt;br /&gt;
  t0 t1 t2 t3 ... t116 t117&lt;br /&gt;
&lt;br /&gt;
  % ns_set name t8&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsection]], [[ns_set]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsection&amp;diff=5295</id>
		<title>Ns configsection</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_configsection&amp;diff=5295"/>
		<updated>2009-02-07T19:48:38Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;manpage&amp;gt;ns_configsection&amp;lt;/manpage&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_configsection - Return a handle to an [[ns_set]] for a section of the server's configuration&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_configsection''' ''section''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
This command returns a handle for an [[ns_set]] which contains all the parameter key-value pairs for the ''section'' from the server's configuration.  If the ''section'' is not defined, this command returns an empty string.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % set setId [ns_configsection ns/parameters]&lt;br /&gt;
  t0&lt;br /&gt;
&lt;br /&gt;
  % ns_set name $setId&lt;br /&gt;
  ns/parameters&lt;br /&gt;
&lt;br /&gt;
  % array set a [ns_set array $setId]&lt;br /&gt;
  % array names a&lt;br /&gt;
  EnableAdmin MailHost Home Group User debug&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_config]], [[ns_configsections]], [[ns_set]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_config&amp;diff=5294</id>
		<title>Ns config</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_config&amp;diff=5294"/>
		<updated>2009-02-07T19:48:15Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_config.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_config - Extract configuration information from the server&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_config''' ''?-exact | -bool | -int? section key ?default?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
 &lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If ''-exact'' is specified, matching on ''key'' is case-sensitive.  By default, matching is case-insensitive.&lt;br /&gt;
&lt;br /&gt;
If ''-bool'' is specified, '''ns_config''' will perform the conversion of a boolean value from &amp;quot;on&amp;quot;, &amp;quot;1&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;yes&amp;quot;, &amp;quot;t&amp;quot;, and &amp;quot;true&amp;quot; to &amp;quot;1&amp;quot;, and it will convert a boolean value of &amp;quot;off&amp;quot;, &amp;quot;0&amp;quot;, &amp;quot;n&amp;quot;, &amp;quot;no&amp;quot;, &amp;quot;f&amp;quot;, and &amp;quot;false&amp;quot; to &amp;quot;0&amp;quot;.  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.&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
  % ns_config ns/parameters debug&lt;br /&gt;
  off&lt;br /&gt;
&lt;br /&gt;
  % string length [ns_config dummy dummy]&lt;br /&gt;
  0&lt;br /&gt;
&lt;br /&gt;
  % ns_config dummy dummy default&lt;br /&gt;
  default&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_configsection]], [[ns_configsections]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5293</id>
		<title>Ns parsetime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5293"/>
		<updated>2009-02-07T19:46:41Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_parsetime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_parsetime - Return an element from the time structure list&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSYS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_parsetime''' ''option time''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command takes a nine-element Tcl list as ''time'' representing the Unix '''struct tm''' structure (as would be returned from [[ns_gmtime]] or [[ns_localtime]]) and based on ''option'', returns an element from the list.  The valid ''option''s are: sec, min, hour, mday, mon, year, wday, yday, isdst.  The options are listed in order of the actual elements in the Tcl list itself.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLE'''&lt;br /&gt;
&lt;br /&gt;
    % set time [ [[ns_localtime]] ]&lt;br /&gt;
    33 33 22 11 5 104 5 162 1&lt;br /&gt;
&lt;br /&gt;
    % expr {1900 + [ [[ns_parsetime]] year $time]}&lt;br /&gt;
    2004&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5292</id>
		<title>Ns parsetime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5292"/>
		<updated>2009-02-07T19:46:07Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_parsetime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_parsetime - Return an element from the time structure list&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSYS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_parsetime''' ''option time''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command takes a nine-element Tcl list as ''time'' representing the Unix '''struct tm''' structure (as would be returned from [[ns_gmtime]] or [[ns_localtime]]) and based on ''option'', returns an element from the list.  The valid ''option''s are: sec, min, hour, mday, mon, year, wday, yday, isdst.  The options are listed in order of the actual elements in the Tcl list itself.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLE'''&lt;br /&gt;
&lt;br /&gt;
    % set time [[[ns_localtime]]]&lt;br /&gt;
    33 33 22 11 5 104 5 162 1&lt;br /&gt;
&lt;br /&gt;
    % expr {1900 + [[ns_parsetime year $time]]}&lt;br /&gt;
    2004&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5291</id>
		<title>Ns parsetime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsetime&amp;diff=5291"/>
		<updated>2009-02-07T19:45:29Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_parsetime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_parsetime - Return an element from the time structure list&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSYS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_parsetime''' ''option time''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command takes a nine-element Tcl list as ''time'' representing the Unix '''struct tm''' structure (as would be returned from [[ns_gmtime]] or [[ns_localtime]]) and based on ''option'', returns an element from the list.  The valid ''option''s are: sec, min, hour, mday, mon, year, wday, yday, isdst.  The options are listed in order of the actual elements in the Tcl list itself.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLE'''&lt;br /&gt;
&lt;br /&gt;
    % set time [[ns_localtime]]&lt;br /&gt;
    33 33 22 11 5 104 5 162 1&lt;br /&gt;
&lt;br /&gt;
    % expr {1900 + [[ns_parsetime year $time]]}&lt;br /&gt;
    2004&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsehttptime&amp;diff=5290</id>
		<title>Ns parsehttptime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_parsehttptime&amp;diff=5290"/>
		<updated>2009-02-07T19:45:13Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_parsehttptime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_parsehttptime - Convert a HTTP date format string into seconds&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_parsehttptime''' ''httptime''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command parses a string containing an HTTP date format string (see [http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 RFC 2616 Sec 3.3]) and returns the number of seconds since 00:00:00 UTC Jan 1, 1970.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_parsehttptime &amp;quot;Thu, 01 Jan 1970 00:00:00 GMT&amp;quot;&lt;br /&gt;
    0&lt;br /&gt;
&lt;br /&gt;
    % ns_parsehttptime &amp;quot;Thu, 14 Nov 2002 17:29:06 GMT&amp;quot;&lt;br /&gt;
    1037294946&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsetime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_localtime&amp;diff=5289</id>
		<title>Ns localtime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_localtime&amp;diff=5289"/>
		<updated>2009-02-07T19:44:55Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;manpage&amp;gt;ns_localtime&amp;lt;/manpage&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_localtime - Return current time in local timezone&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_localtime'''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command returns a nine-element Tcl list representing the current time in the system's current timezone.  The structure of the list corresponds to the Unix '''struct tm''' time structure:&lt;br /&gt;
&lt;br /&gt;
:* seconds (0-59)&lt;br /&gt;
:* minutes (0-59)&lt;br /&gt;
:* hours (0-23)&lt;br /&gt;
:* dayofmonth (1-31)&lt;br /&gt;
:* monthofyear (0-11)&lt;br /&gt;
:* year (year-1900)&lt;br /&gt;
:* dayofweek (0-6, Sunday=0)&lt;br /&gt;
:* dayofyear (0-365)&lt;br /&gt;
:* isdst (&amp;gt;0 if Daylight Savings Time is in effect)&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_localtime&lt;br /&gt;
    33 33 22 11 5 104 5 162 1&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_parsehttptime]], [[ns_parsetime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_cookietime&amp;diff=5288</id>
		<title>Ns cookietime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_cookietime&amp;diff=5288"/>
		<updated>2009-02-07T19:44:38Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_cookietime - Convert seconds to Netscape's cookie date format&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_cookietime''' ''time''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command converts the time, specified as the number of seconds from 00:00:00 UTC Jan 1, 1970, to a string in Netscape's old cookie &amp;quot;Expires&amp;quot; date format (see [http://www.w3.org/Protocols/rfc2109/rfc2109.txt RFC 2109 Sec 10.1.2]).&lt;br /&gt;
&lt;br /&gt;
'''CODE'''&lt;br /&gt;
&lt;br /&gt;
: '''NOTE:''' This command is not yet part of the standard core Tcl API for AOLserver.&lt;br /&gt;
&lt;br /&gt;
  proc ns_cookietime {time} {&lt;br /&gt;
      regsub {, (\d+) (\S+) (\d+)} [[ns_httptime $time]] {, \1-\2-\3} string&lt;br /&gt;
      return $string&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_cookietime 0&lt;br /&gt;
    Thu, 01-Jan-1970 00:00:00 GMT&lt;br /&gt;
&lt;br /&gt;
    % ns_cookietime 8675309&lt;br /&gt;
    Sat, 11-Apr-1970 09:48:29 GMT&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_fmttime]], [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_parsetime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_httptime&amp;diff=5287</id>
		<title>Ns httptime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_httptime&amp;diff=5287"/>
		<updated>2009-02-07T19:44:21Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_httptime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_httptime - Convert seconds to HTTP date format&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_httptime''' ''time''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command converts the time, specified as the number of seconds from 00:00:00 UTC Jan 1, 1970, to a string in HTTP date format (see [http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 RFC 2616 Sec 3.3]).&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_httptime 0&lt;br /&gt;
    Thu, 01 Jan 1970 00:00:00 GMT&lt;br /&gt;
&lt;br /&gt;
    % ns_httptime 8675309                               &lt;br /&gt;
    Sat, 11 Apr 1970 09:48:29 GMT&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_cookietime]], [[ns_fmttime]], [[ns_gmtime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_parsetime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_fmttime&amp;diff=5286</id>
		<title>Ns fmttime</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_fmttime&amp;diff=5286"/>
		<updated>2009-02-07T19:43:53Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_fmttime.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_fmttime - Convert seconds to a human-readable format using templates&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_fmttime''' ''time ?fmt?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command produces a string representation of ''time'' in seconds since 00:00:00 UTC Jan 1, 1970.&lt;br /&gt;
&lt;br /&gt;
: '''ns_fmttime''' uses the '''strftime()''' system call, so valid ''fmt'' strings will vary from platform to platform.  Consult your operating system's documentation for '''strftime()''' to see what valid ''fmt'' strings can contain.  ''fmt'' defaults to &amp;quot;%c&amp;quot; which is supposed to be the preferred date and time representation for the current locale, which on some platforms should be &amp;quot;%a %b %e %H:%M:%S %Z %Y&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_fmttime 0&lt;br /&gt;
    Wed Dec 31 19:00:00 1969&lt;br /&gt;
&lt;br /&gt;
    % ns_fmttime 0 &amp;quot;%a %b %e %H:%M:%S %Z %Y&amp;quot;&lt;br /&gt;
    Wed Dec 31 19:00:00 EST 1969&lt;br /&gt;
&lt;br /&gt;
    % ns_fmttime [[ns_time]] &amp;quot;%Y%m%d&amp;quot;&lt;br /&gt;
    20040614&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_gmtime]], [[ns_httptime]], [[ns_localtime]], [[ns_parsehttptime]], [[ns_parsetime]], [[ns_time]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_names&amp;diff=5285</id>
		<title>Nsv names</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_names&amp;diff=5285"/>
		<updated>2009-02-07T19:42:06Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_names.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_names - List the nsvs in use&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_names''' ''?pattern?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Return a list of all the nsvs in use, optionally only those matching ''pattern''. If no matching nsvs are in use returns the empty string.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_names&lt;br /&gt;
    shared_array&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_array&amp;diff=5284</id>
		<title>Nsv array</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_array&amp;diff=5284"/>
		<updated>2009-02-07T19:41:46Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_array.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_array - Tcl array functionality in nsvs&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' get ''array'' ''?pattern?''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' set ''array'' ''value-list''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' reset ''array'' ''value-list''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' exists ''array''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' size ''array''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_array''' names ''array'' ''?pattern?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: nsv_array works much like the Tcl array command.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
Basic&lt;br /&gt;
    % nsv_array set shared_array { key1 value1 key2 value2 }&lt;br /&gt;
    &lt;br /&gt;
    % nsv_array get shared_array&lt;br /&gt;
    key1 value1 key2 value2&lt;br /&gt;
&lt;br /&gt;
    % nsv_array reset shared_array { key3 value3 }&lt;br /&gt;
&lt;br /&gt;
    % nsv_array exists shared_array&lt;br /&gt;
    1&lt;br /&gt;
&lt;br /&gt;
    % nsv_array size shared_array&lt;br /&gt;
    1&lt;br /&gt;
&lt;br /&gt;
    % nsv_array names shared_array&lt;br /&gt;
    key3&lt;br /&gt;
&lt;br /&gt;
Working with tcl arrays&lt;br /&gt;
&lt;br /&gt;
    % nsv_array set shared_array [array get tmp_shared_array]&lt;br /&gt;
&lt;br /&gt;
    % array set tmp_shared_array [nsv_array get shared_array]&lt;br /&gt;
&lt;br /&gt;
    % nsv_array reset shared_array [array get tmp_shared_array]&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_unset&amp;diff=5283</id>
		<title>Nsv unset</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_unset&amp;diff=5283"/>
		<updated>2009-02-07T19:41:23Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_unset.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_unset - Unset an array or a key&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_unset''' ''array'' ''?key?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Unset an array or a single key from an array. If successful returns an empty string.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_unset shared_array key1&lt;br /&gt;
&lt;br /&gt;
unset a key&lt;br /&gt;
&lt;br /&gt;
    %nsv_unset shared_array&lt;br /&gt;
&lt;br /&gt;
unset an array&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_lappend&amp;diff=5282</id>
		<title>Nsv lappend</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_lappend&amp;diff=5282"/>
		<updated>2009-02-07T19:41:04Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_lappend.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_lappend - Append to the list specified by the key&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_lappend''' ''array'' ''key'' ''value'' ''?value ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Append all of the value arguments as list elements to variable ''key'' in the array. If ''key'' doesn't exist, it is created as a list with elements given by the value arguments&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_lappend shared_array key1 value2&lt;br /&gt;
    value1 value2&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_append&amp;diff=5281</id>
		<title>Nsv append</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_append&amp;diff=5281"/>
		<updated>2009-02-07T19:40:45Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_append.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_append - Append to the value specified by the key&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_append''' ''array'' ''key'' ''value'' ''?value ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Append all of the value arguments to the current value of variable ''key'' in the array. If ''key'' doesn't exist, it is given a value equal to the concatenation of all the value arguments&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_append shared_array key1 foo&lt;br /&gt;
    value1foo&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_set&amp;diff=5280</id>
		<title>Nsv set</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_set&amp;diff=5280"/>
		<updated>2009-02-07T19:40:28Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_set.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_set - Set a key value&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_set''' ''array'' ''key'' ''value''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Set the value for a key in an nsv array. Returns the value the key is set to.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_set shared_array key1 value1&lt;br /&gt;
    value1&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_exists&amp;diff=5279</id>
		<title>Nsv exists</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_exists&amp;diff=5279"/>
		<updated>2009-02-07T19:40:04Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_exists.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_exists - Test whether a key exists&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_exists''' ''array'' ''key''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Test whether a key exists in the nsv array.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_exists shared_array key1&lt;br /&gt;
    1&lt;br /&gt;
&lt;br /&gt;
the key exists&lt;br /&gt;
&lt;br /&gt;
    % nsv_exists shared_array key2&lt;br /&gt;
    0&lt;br /&gt;
&lt;br /&gt;
the key does not exist &lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_get&amp;diff=5278</id>
		<title>Nsv get</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Nsv_get&amp;diff=5278"/>
		<updated>2009-02-07T19:39:43Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/nsv_get.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: nsv_get - Get a key value&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''nsv_get''' ''array'' ''key''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: Get the value for the key from the nsv array.  Error occurs if key does not exist.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % nsv_get shared_array key1&lt;br /&gt;
    value1&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[Thread-shared Variables]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_weekly&amp;diff=5277</id>
		<title>Ns schedule weekly</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_weekly&amp;diff=5277"/>
		<updated>2009-02-07T19:37:58Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_schedule_weekly.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_schedule_weekly - Schedule a script to run on a certain day of the week at a certain time&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_schedule_weekly''' ''?-once? ?-thread? day hour minute script''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command schedules a ''script'' to be run on a certain ''day'' of the week at a certain ''hour'' and ''minute'' of that day.  Returns the ID of the newly scheduled script.  The week starts on Sunday as day zero and runs to Saturday as day six.  If ''-once'' is specified, then the script is run once and then unscheduled, otherwise it will continue to run every week on that day at that time.  If ''-thread'' is specified, then the script will be run in its own thread, otherwise it will run in the scheduler's thread.  If the script is long-running, this may interfere with the running of other scheduled scripts, so long-running scripts should be run in their own threads.&lt;br /&gt;
&lt;br /&gt;
: '''NOTE:''' ''day'', ''hour'' and ''minute'' are specified in local time.  Beware of Daylight Savings Time shifts affecting the time of day when the script will execute.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set id [[ns_schedule_weekly -once 2 5 35 { ns_log notice &amp;quot;It is now Tuesday at 5:35 AM.&amp;quot; }]]&lt;br /&gt;
    123&lt;br /&gt;
&lt;br /&gt;
    % ns_unschedule_proc $id&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_after]], [[ns_info]] scheduled, [[ns_pause]], [[ns_resume]], [[ns_schedule_proc]], [[ns_schedule_daily]], [[ns_unschedule_proc]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_proc&amp;diff=5276</id>
		<title>Ns schedule proc</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_proc&amp;diff=5276"/>
		<updated>2009-02-07T19:37:41Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_schedule_proc.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_schedule_proc - Schedule a script to run after a certain number of seconds&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_schedule_proc''' ''?-once? ?-thread? interval script''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command schedules a script to be run after a certain number of seconds.  Returns the ID of the newly scheduled script.  If ''-once'' is specified, then the script is run once and then unscheduled, otherwise it will continue to run every ''interval'' seconds.  If ''-thread'' is specified, then the script will be run in its own thread, otherwise it will run in the scheduler's thread.  If the script is long-running, this may interfere with the running of other scheduled scripts, so long-running scripts should be run in their own threads.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set id [[ns_schedule_proc -once 60 { ns_log notice &amp;quot;this should run in 60 seconds&amp;quot; }]]&lt;br /&gt;
    123&lt;br /&gt;
&lt;br /&gt;
    % ns_unschedule_proc $id&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_after]], [[ns_info]] scheduled, [[ns_pause]], [[ns_resume]], [[ns_schedule_daily]], [[ns_schedule_weekly]], [[ns_unschedule_proc]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_daily&amp;diff=5275</id>
		<title>Ns schedule daily</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_schedule_daily&amp;diff=5275"/>
		<updated>2009-02-07T19:37:18Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_schedule_daily.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_schedule_daily - Schedule a script to run daily at a certain time&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_schedule_daily''' ''?-once? ?-thread? hour minute script''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command schedules a ''script'' to be run at a certain ''hour'' and ''minute'' of the day.  Returns the ID of the newly scheduled script.  If ''-once'' is specified, then the script is run once and then unscheduled, otherwise it will continue to run every day at that time.  If ''-thread'' is specified, then the script will be run in its own thread, otherwise it will run in the scheduler's thread.  If the script is long-running, this may interfere with the running of other scheduled scripts, so long-running scripts should be run in their own threads.&lt;br /&gt;
&lt;br /&gt;
: '''NOTE:''' ''hour'' and ''minute'' are specified in local time.  Beware of Daylight Savings Time shifts affecting the time of day when the script will execute.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set id [[ns_schedule_daily -once 5 35 { ns_log notice &amp;quot;It is now 5:35 AM.&amp;quot; }]]&lt;br /&gt;
    123&lt;br /&gt;
&lt;br /&gt;
    % ns_unschedule_proc $id&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_after]], [[ns_info]] scheduled, [[ns_pause]], [[ns_resume]], [[ns_schedule_proc]], [[ns_schedule_weekly]], [[ns_unschedule_proc]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_pause&amp;diff=5274</id>
		<title>Ns pause</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_pause&amp;diff=5274"/>
		<updated>2009-02-07T19:36:42Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_pause.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_pause - Pause a scheduled script from running&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_pause''' ''id''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command pauses a scheduled script from running at its next scheduled time.  Returns 1 on success, 0 on failure.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set id [[ns_schedule_daily 1 0 { ns_log notice &amp;quot;One AM and all is well.  *gong*&amp;quot; }]]&lt;br /&gt;
    19&lt;br /&gt;
&lt;br /&gt;
    % ns_pause $id&lt;br /&gt;
    1&lt;br /&gt;
&lt;br /&gt;
    % ns_unschedule_proc $id&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_info]] scheduled, [[Ns_Resume]], [[ns_unschedule_proc]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_after&amp;diff=5273</id>
		<title>Ns after</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_after&amp;diff=5273"/>
		<updated>2009-02-07T19:36:22Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_after.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_after - Execute a command after a time delay&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_after''' ''seconds script''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command executes a script in the background after a number of seconds time delay.  It does this by scheduling a one-shot event in the scheduler.  Uncaught script errors will go to the server log.  It returns an ID which can be used to unschedule the execution of the script (if ''seconds'' hasn't elapsed) using [[ns_unschedule_proc]].&lt;br /&gt;
&lt;br /&gt;
: The script when executed will run in the scheduler thread.  If the script is long-running, this may interfere with the execution of other scheduled scripts, in which case [[ns_schedule_proc]] should be used instead of '''ns_after'''.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_after 5 { ns_log notice &amp;quot;ns_after script executed&amp;quot; }&lt;br /&gt;
    123&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_info]] scheduled, [[ns_pause]], [[ns_resume]], [[ns_schedule_daily]], [[ns_schedule_proc]], [[ns_schedule_weekly]], [[ns_unschedule_proc]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_unschedule_proc&amp;diff=5272</id>
		<title>Ns unschedule proc</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_unschedule_proc&amp;diff=5272"/>
		<updated>2009-02-07T19:35:53Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_unschedule_proc.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_unschedule_proc - Unschedule a previously scheduled script&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_unschedule_proc''' ''id''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command unschedules a previous scheduled script.  '''NOTE:''' Current behavior is to silently return without error if the ''id'' doesn't represent a currently scheduled ID.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % set id [[ns_schedule_proc -once 60 { test }]]&lt;br /&gt;
    123&lt;br /&gt;
&lt;br /&gt;
    % ns_unschedule_proc $id&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_after]], [[ns_info]] scheduled, [[ns_pause]], [[ns_resume]], [[ns_schedule_proc]], [[ns_schedule_daily]], [[ns_schedule_weekly]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_server&amp;diff=5271</id>
		<title>Ns server</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_server&amp;diff=5271"/>
		<updated>2009-02-07T19:34:56Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_server.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_server - Get state of the server's connection pools and queues&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_server''' ''option ?pool?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command provides a way to examine the current server's connection pools and queues.  The legal ''option''s (which may be abbreviated) are:&lt;br /&gt;
* '''ns_server active''' ''?pool?''&lt;br /&gt;
* '''ns_server all''' ''?pool?''&lt;br /&gt;
* '''ns_server connections''' ''?pool?''&lt;br /&gt;
* '''ns_server keepalive''' ''?pool?''&lt;br /&gt;
* '''ns_server pools''' ''?pool?''&lt;br /&gt;
* '''ns_server queued''' ''?pool?''&lt;br /&gt;
* '''ns_server threads''' ''?pool?''&lt;br /&gt;
&lt;br /&gt;
: Returns a list of key-value pairs identifying the number of connection threads and what state they are currently in.&lt;br /&gt;
* '''ns_server waiting''' ''?pool?''&lt;br /&gt;
&lt;br /&gt;
'''NOTES'''&lt;br /&gt;
&lt;br /&gt;
: See [http://sourceforge.net/tracker/index.php?func=detail&amp;amp;aid=745784&amp;amp;group_id=3152&amp;amp;atid=103152 Bug #745784] -- '''ns_server''' is not safe under load because: &amp;quot;The problem is either the connPtr or some of the data buried in the conn can be changing in the running connection thread.  I wouldn't suggest this be fixed because it could complicate the code and introduce a performance problem.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    % ns_server threads&lt;br /&gt;
    {min 0} {max 10} {current 0} {idle 0} {stopping 0}&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_info&amp;diff=5270</id>
		<title>Ns info</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_info&amp;diff=5270"/>
		<updated>2009-02-07T19:34:25Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/man/4.0/tcl/ns_info.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_info - Return information about various aspects of the running AOLserver&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_info''' ''option ?arg arg ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command provides information about the current state of the running AOLserver.  The legal ''option''s (which may be abbreviated) are:&lt;br /&gt;
* '''ns_info address'''&lt;br /&gt;
&lt;br /&gt;
: returns the primary IP address of this machine, or &amp;quot;0.0.0.0&amp;quot; if unable to determine&lt;br /&gt;
* '''ns_info argv0'''&lt;br /&gt;
* '''ns_info boottime'''&lt;br /&gt;
&lt;br /&gt;
: returns the time in epoch seconds since the current server was started&lt;br /&gt;
* '''ns_info builddate'''&lt;br /&gt;
&lt;br /&gt;
: returns the date and time at which the current server was compiled, e.g.: &amp;quot;Jul 20 2004 at 14:57:20&amp;quot;&lt;br /&gt;
* '''ns_info callbacks'''&lt;br /&gt;
* '''ns_info config'''&lt;br /&gt;
&lt;br /&gt;
: returns the absolute path to the config file used to start the server&lt;br /&gt;
* '''ns_info home'''&lt;br /&gt;
&lt;br /&gt;
: returns the current working directory of the server&lt;br /&gt;
* '''ns_info hostname'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of gethostname(), or &amp;quot;localhost&amp;quot; if that fails&lt;br /&gt;
* '''ns_info label'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of NSD_LABEL from nsd.h, e.g. &amp;quot;aolserver4_0&amp;quot;&lt;br /&gt;
* '''ns_info locks'''&lt;br /&gt;
&lt;br /&gt;
: lists the mutexes that currently exist.  A 5-element list is returned for each mutex: [[User:Dossy|Dossy]] mutex name, {}, unique id, lock counter, busy counter&lt;br /&gt;
* '''ns_info log'''&lt;br /&gt;
&lt;br /&gt;
: returns the name of the error log specified by the &amp;quot;serverlog&amp;quot; parameter in the &amp;quot;ns/parameters&amp;quot; section, or &amp;quot;server.log&amp;quot; if not defined.  Prepends the server's current working directory&lt;br /&gt;
* '''ns_info major'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of NS_MAJOR_VERSION from ns.h, e.g. &amp;quot;4&amp;quot;&lt;br /&gt;
* '''ns_info minor'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of NS_MINOR_VERSION from ns.h, e.g. &amp;quot;0&amp;quot;&lt;br /&gt;
* '''ns_info name'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of NSD_NAME from nsd.h (currently 'AOLserver')&lt;br /&gt;
* '''ns_info nsd'''&lt;br /&gt;
&lt;br /&gt;
: returns the absolute path to the currently running nsd binary&lt;br /&gt;
* '''ns_info pageroot'''&lt;br /&gt;
&lt;br /&gt;
: returns the absolute path to the page root&lt;br /&gt;
* '''ns_info patchlevel'''&lt;br /&gt;
&lt;br /&gt;
: returns the value of NS_PATCH_LEVEL from ns.h, e.g. &amp;quot;4.0.7&amp;quot;&lt;br /&gt;
* '''ns_info pid'''&lt;br /&gt;
&lt;br /&gt;
: returns the process ID of the current nsd process&lt;br /&gt;
* '''ns_info platform'''&lt;br /&gt;
&lt;br /&gt;
: returns the name of the current platform, or &amp;quot;?&amp;quot; if unable to determine&lt;br /&gt;
* '''ns_info pools'''&lt;br /&gt;
* '''ns_info scheduled'''&lt;br /&gt;
* '''ns_info server'''&lt;br /&gt;
* '''ns_info servers'''&lt;br /&gt;
* '''ns_info sockcallbacks'''&lt;br /&gt;
* '''ns_info tag'''&lt;br /&gt;
&lt;br /&gt;
: returns the CVS tag (NSD_TAG from nsd.h); not guaranteed to be useful&lt;br /&gt;
* '''ns_info tcllib'''&lt;br /&gt;
* '''ns_info threads'''&lt;br /&gt;
* '''ns_info uptime'''&lt;br /&gt;
* '''ns_info version'''&lt;br /&gt;
* '''ns_info winnt'''&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_env&amp;diff=5269</id>
		<title>Ns env</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_env&amp;diff=5269"/>
		<updated>2009-02-07T19:33:52Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_env.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_env - Return, change or add a value of an environment variable&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_env''' ''option ?arg arg ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command provides thread-safe (unlike Tcl env array) access to the environemnt variables of the currently running [[nsd]] process.  The legal ''option''s (which may '''NOT''' be abbreviated) are:&lt;br /&gt;
: '''ns_env names'''&lt;br /&gt;
: '''ns_env exists''' ''name''&lt;br /&gt;
: '''ns_env get''' ''?-nocomplain? name''&lt;br /&gt;
: '''ns_env set''' ''name value''&lt;br /&gt;
: '''ns_env unset''' ''?-nocomplain? name''&lt;br /&gt;
&lt;br /&gt;
: This command has yet to be Tcl_Obj'ified.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 % ns_env names&lt;br /&gt;
 CONSOLE TERM INIT_VERSION PATH RUNLEVEL PWD PREVLEVEL SHLVL HOME&lt;br /&gt;
&lt;br /&gt;
 % ns_env get PATH&lt;br /&gt;
 /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin&lt;br /&gt;
&lt;br /&gt;
 % ns_env set USER nsd&lt;br /&gt;
&lt;br /&gt;
 % ns_env get USER&lt;br /&gt;
 nsd&lt;br /&gt;
&lt;br /&gt;
 % ns_env unset USER&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_atsignal&amp;diff=5268</id>
		<title>Ns atsignal</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_atsignal&amp;diff=5268"/>
		<updated>2009-02-07T19:33:02Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_atsignal.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_atsignal - Queue a script to run when the server receives the SIGHUP signal&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_atsignal''' ''script ?arg?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
This command queues a script to run when the server receives the SIGHUP signal.  The script and optional arg are concatenated together and added to the list of signal callbacks.  The scripts are executed in the global scope in LIFO (last in, first out) order.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_atclose]], [[ns_atexit]], [[ns_atshutdown]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_atshutdown&amp;diff=5267</id>
		<title>Ns atshutdown</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_atshutdown&amp;diff=5267"/>
		<updated>2009-02-07T19:32:38Z</updated>

		<summary type="html">&lt;p&gt;Gustafn: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_atshutdown.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
ns_atshutdown - Queue a script to run when the server is shutting down&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
'''ns_atshutdown''' ''script ?arg?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
This command queues a script to run when the server is shutting down.  The script and optional arg are concatenated together and added to the list of shutdown callbacks.  The scripts are executed in the global scope in LIFO (last in, first out) order.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
Use [[ns_atsignal]] to stop long running processes. It seems that [[ns_atshutdown]] and [[ns_atexit]] are called after connection and scheduled threads have been killed, so those commands can not be used for that type of signal.&lt;br /&gt;
&lt;br /&gt;
    # Create share variables for each signal&lt;br /&gt;
    foreach signal {SIGHUP TERM EXIT} {&lt;br /&gt;
        nsv_set . $signal 0&lt;br /&gt;
        ns_log notice &amp;quot;Listening for $signal&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    proc heard_signal signal {&lt;br /&gt;
        nsv_set . $signal 1&lt;br /&gt;
        ns_log notice &amp;quot;Heard $signal&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    ns_atsignal heard_signal SIGHUP&lt;br /&gt;
    ns_atshutdown heard_signal TERM&lt;br /&gt;
    ns_atexit heard_signal EXIT&lt;br /&gt;
    &lt;br /&gt;
    # Long running proc&lt;br /&gt;
    proc infinite_loop {} {&lt;br /&gt;
        set status &amp;quot;RUN&amp;quot;&lt;br /&gt;
        while {1} {&lt;br /&gt;
            # Do some work&lt;br /&gt;
            ns_sleep 1&lt;br /&gt;
            ns_log notice &amp;quot;infinite_loop working, status: $status&amp;quot;&lt;br /&gt;
            # Poll for signals&lt;br /&gt;
            foreach signal {SIGHUP TERM EXIT} {&lt;br /&gt;
                if {[nsv_get . $signal]} {&lt;br /&gt;
                    set status $signal&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            if {$signal ne &amp;quot;RUN&amp;quot;} {&lt;br /&gt;
                break&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        # Save work&lt;br /&gt;
        ns_log notice &amp;quot;infinite_loop stopped, status: $status&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
    ns_schedule_proc -thread -once 10 infinite_loop&lt;br /&gt;
&lt;br /&gt;
Sample log file output from AOLserver 4.0.3 for [[ns_atsignal]]:&lt;br /&gt;
&lt;br /&gt;
    [01/Aug/2006:10:30:56][1359.1][-main-] Notice: Heard SIGHUP&lt;br /&gt;
    [01/Aug/2006:10:30:56][1359.8][-sched:12-] Notice: infinite_loop stopped, status: SIGHUP&lt;br /&gt;
    [01/Aug/2006:10:30:56][1359.9][-conn:server::0] Notice: infinite_loop stopped, status: SIGHUP&lt;br /&gt;
&lt;br /&gt;
Sample log file output from AOLserver 4.0.3 for [[ns_atshutdown]] and [[ns_atexit]]:&lt;br /&gt;
&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.1][-main-] Notice: nsmain: AOLserver/4.0.3 stopping&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.1][-main-] Notice: serv: stopping server: server&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.1][-main-] Notice: serv: connection threads stopped&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.1][-main-] Notice: driver: shutdown complete&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.1][-main-] Notice: sched: shutdown pending&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.3][-sched-] Notice: sched: shutdown started&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.3][-sched-] Notice: sched: waiting for event threads...&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.8][-sched:idle0-] Notice: exiting&lt;br /&gt;
    [31/Jul/2006:15:57:52][3583.3][-sched-] Notice: sched: shutdown complete&lt;br /&gt;
    [31/Jul/2006:15:57:53][3583.9][-shutdown-] Notice: Heard TERM&lt;br /&gt;
    [31/Jul/2006:15:57:53][3583.9][-shutdown-] Notice: nslog: closing '/var/log/aolserver/server.log'&lt;br /&gt;
    [31/Jul/2006:15:57:53][3583.1][-main-] Notice: Heard EXIT&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
[[ns_atclose]], [[ns_atexit]], [[ns_atsignal]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]] - [[Category:Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>Gustafn</name></author>
		
	</entry>
</feed>