web_include
fileName
?msg
?If the file fileName exists, it is sourced (must be a script). Otherwise if the library fileName+"shared lib extension" exists, it is loaded (must be a shared library). Returns 0 on success, 1 otherwise. If an error occurs, an error message is written to msg.
web::readfile
file
varName
msg
file is read and written to varName. Returns 0 on success, 1 otherwise. If an error occurs, an error message is written to the variable msg.
web::lockfile
fh
web::unlockfile
fh
Interface to lockf(). lockf() works best on local filesystems. Please read the documentation of lockf on your system to learn about the problems and limitations of file locking. Note that web::lockfile also performs a seek() and resets the file cursor to the beginning of the file. Note that the file needs to be open for writing.
web::truncatefile
fh
Interface to truncate(). Truncates a file based on the file handle, while Tcl's file commands are based on file names. This is used to truncate a file while holding the lock.
Example 14. web::lockfile
set fh [open [web::tempfile] w] web::lockfile $fh puts $fh foo web::unlockfile $fh close $fh