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

file-binary-bytes Function

Summary

Creates a vector from the contents of a file.

Package

hcl

Signature

file-binary-bytes pathname &key length element-type => vector

Arguments
pathname
A pathname designator.
length
An integer or nil.
element-type
A valid array element type.
Values
vector
A vector with element type element-type.
Description

The function file-binary-bytes reads the bytes of the file specified by pathname and returns a vector containing those bytes.

length specifies the length of the vector to create. If length is nil (the default), file-binary-bytes uses the length of the file. If the file is shorter than length, the rest of the vector is uninitialized.

element-type is used both to specify the element type of vector and for opening the file. It should be one of the "natural" binary element types such as (unsigned-byte 8) (the default) or (signed-byte 16).


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