Ns writefp

From AOLserver Wiki
Jump to navigation Jump to search

NAME

ns_writefp - Write bytes from an open channel to the current connection's socket.

SYNOPSIS

ns_writefp chanId ?nbytes?

DESCRIPTION

This command writes the contents of a file or other open channel referenced by chanId immediately to the current connection's socket. It can be used in place of ns_returnfp or ns_respond to send back responses. AOLserver will not include any headers when using ns_writefp.
You can specify the number of bytes to be copied in the nbytes argument. By default, the entire file/channel contents is copied. chanId is channel identifier such as returned by the Tcl command open.
This command does the exact same thing as the deprecated ns_connsendfp. The difference is ns_writefp allows the nbytes argument to be omitted and it does not accept the legacy connid parameter.

SEE ALSO

ns_startcontent, ns_write, ns_return

Category Documentation - Category Core Tcl API