All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

file-string Function

Summary

Returns the contents of a file as a string.

Package

hcl

Signature

file-string file &key length external-format => string

Arguments
file
A pathname designator.
length
An integer or nil (the default).
external-format
An external format specification.
Values
string
A string.
Description

The function file-string returns the entire contents of file (if length is nil), or the first length characters, as a string.

external-format is interpreted as for open. The default value is :default.

Examples
CL-USER 26 > file-string "configure.lisp" :length 18
";; -*- Mode: Lisp;"
See also

guess-external-format


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35