Hans van der Meer via ntg-context schrieb am 17.08.2021 um 15:15:
Is it possible to retrieve the contents of a file directly into a buffer? On the Wiki I could not find such a command. That is, equivalent to something like:
\startbuffer[from file]
contents of the file
\stopbuffer

Yes and no. The \samplefile command used to read file for example
stores the content of a file in a buffer to avoid rereading the file each
time the content is output but there is no way to suppress the output
neither to change the name of the buffer.

\starttext

\startnointerference
\samplefile{knuth}
\stopnointerference

\typebuffer[knuth]

\getbuffer[knuth]

\stoptext

Wolfgang