spew - print files

SYNOPSIS

<spew $files [$offset [$length]]>


DESCRIPTION
The spew function reads each file given in $files and prints it out verbatim. If "-" (single dash) is given, the standard input is sent.

Normally the entire file is printed. If an $offset is given, printing starts at that offset into the file. Negative offsets apply from the end of the file. If a $length is also given, that many bytes are printed; the default is the rest of the file. Negative lengths indicate the rest of the file. The $offset and $length arguments are parallel to $files; if they have fewer values than $files the last value is re-used.


DIAGNOSTICS
spew returns 1 for each value of $files if successful, or an empty string if not.


CAVEATS
No path checking is done on the given files, so any file on the machine that is readable can be read, even if outside the HTML document tree.

Support for standard input was added in version 2.6.939400000 19991008. The $offset and $length parameters were added in version 3.0.951100000 20000220.

Reads are unbuffered across calls: repeated small reads of the same file are less efficient than one large read.


SEE ALSO
send, read, fetch


Copyright © Thunderstone Software     Last updated: Apr 15 2024
Copyright © 2024 Thunderstone Software LLC. All rights reserved.