Google

mod_dtcl specific Tcl commands and variables

  • buffer_add string
    Add text to output_buffer for later printing. Used internally.
  • hputs ?-error? text
    The mod_dtcl version of "puts". Outputs to the client, instead of to stdout. The error option permits you to send an 'error message' to the apache log file, at the NOTICE level.
  • var
    These commands retrieve or retrieve information about "CGI" variables that are passed to the dtcl script via GET or POST operations.
  • var get varname
    Returns the value of variable 'varname' as a string (even if there are multiple values).
  • var list varname
    Returns the value of variable 'varname' as a list, if there are multiple values.
  • var exists varname
    Returns 1 if varname exists, 0 if it doesn't.
  • var number
    Returns the number of variables.
  • var all
    Return a list of variable names and values.
  • upload
    These commands retrieve or retrieve information about files that have been uploaded to the server. They replace the UPLOAD variable.
  • upload get varname channel
    Returns a Tcl channel that can be used to access the uploaded file.
  • upload get varname save name
    Moves the uploaded file to the give name.
  • upload get varname data
    Returns data uploaded to the server. This is binary clean.
  • upload info varname exists
    Returns 1 if the variable exists, 0 if not.
  • upload info varname size
    Returns the size of the file uploaded.
  • upload info varname type
    If the Content-type is set, it is returned, otherwise, an empty string.
  • upload info varname filename
    Returns the filename on the remote host that uploaded the file.
  • upload names
    Returns the variable names, as a list, of all the files uploaded.
  • hgetvars
    Get environmental, and Cookie variables. This is in a separate command so as not to make the server do this every time you load a .ttml file. ENVS, CLIENT_ENVS and COOKIES are the associative arrays created. ENVS contains environmental variables. CLIENT_ENVS contains the headers received from the client. COOKIES contains any cookies received from the client.
  • include filename
    Include a file without parsing it. This is the best way to include an HTML file or any other static content.
  • parse filename
    "Source" a .ttml file. This is the way to include other .ttml files.
  • hflush
    Flush the output buffers to the client. Use this if you want to incrementally update a page.
  • headers redirect uri
    Redirect from the current page to a new URI. Must be done in the first block of TCL code.
  • headers setcookie -name cookie-name -value cookie-value ?-expires date/time? ?-domain domain? ?-path path? ?-secure?
    This command is for setting cookies. Cookie-name is the name of the cookie, cookie-value is the data associated with the variable. Expires sets an expiration date for the cookie, and must be in the format 'DD-Mon-YY HH:MM:SS', path sets the path for which the cookie is valid, and secure specifies that the cookie is only to be transmitted if the connection is secure (HTTPS).
  • headers type content-type
    This command sets the "Content-type:" header returned by the script, which is useful if you wish to create a PNG (image), for example, with mod_dtcl.
  • headers set headername value
    Set arbitrary header names and values.
  • makeurl filename
    Create a self referencing URL from a filename. For example: makeurl /tclp.gif returns http://[hostname]:[port]/tclp.gif.
  • dtcl_info
    Prints information on the internals of the module in HTML. Currently, only the PID and size of the object cache are reported.