Next: , Previous: guile-tools scan-md-module, Up: Miscellaneous Tools


13.39 guile-tools slurp

Usage: slurp FILE ...

Read all FILEs into a string and display it to stdout, like cat(1).

Usage from a Scheme program:
 (slurp stuff) => string
 (slurp-file! buf fname-or-port rd-offset len wr-offset) => buf

STUFF is either a list of filenames, each a string, or a single filename.

Unlike `slurp', which allocates a new string, the lower-level procedure
`slurp-file!' modifies (and returns) BUF, a caller-allocated string.
FNAME-OR-PORT is a single string, or a port; and RD-OFFSET, LEN and
WR-OFFSET are integers specifying where to start reading in the file,
how many bytes to read, and where to start writing in BUF, respectively.
RD-OFFSET may also be #f, which means skip the seek.