NaviServer - programmable web server


[ Main Table Of Contents | Table Of Contents | Keyword Index ]

nsvfs(n) 4.99.3 nsvfs "Tcl VFS File Access"

Name

nsvfs - Replacement commands which use the Tcl VFS for file access.

Table Of Contents

Synopsis

Description

nsvfs provides replacements for the builtin naviserver commands which access the file system to serve content. The commands here use the Tcl VFS.

Although slower, this is useful for creating single-file install images, such as starkits.

COMMANDS

vfs_register_fastpath ?-noinherit? ?--? method url

A replacement for the ns_register_fastpath command, using the Tcl VFS for file system access.

To ensure that all static content uses the Tcl VFS, replace the naviserver core fastpath handler by running the following code in your tcl library:

vfs_register_fastpath GET /*
vfs_register_fastpath HEAD /*
vfs_register_fastpath POST /*

You may also decide to register the vfs routines for a subset of the URL hierarchy, such as /admin/*. In this case you could serve admin pages from within the starkit bundle and aditional static pages using the normal fastpath handler.

vfs_returnfile sttaus mime-type filepath

A replacement for the ns_returnfile command, using the Tcl VFS for file system access. No caching is performed.

vfs_respond ?-status status? ?-type mime-type? ?-length length? ?-headers setid? ?-string body? ?-binary body? ?-file filepath? ?-fileid channel?

A replacement for the ns_respond command, using the Tcl VFS for file system access. No caching is performed.

See Also

ns_register_fastpath, ns_respond, ns_returnfile

Keywords

fastpath, file, vfs