0 votes
by ProFrame (260 points)

Hello,

According the manual:

: data-file \ -- size ; DATA-FILE <filename>
Loads a file to memory at HERE and ALLOTs memory. The size of the file is returned. This is a
good way to load data directly into the dictionary at compile time. It avoids having to convert
binary data into streams of digits and commas. For example, DocGen keeps a CSS file in the
dictionary:

This works in my programm with one and predefined filename.
Is it possible to do this after compilation because off more and different filenames?
What would be the word for this to do so?
with regards,
Hugo Overbeek

1 Answer

0 votes
by ProFrame (260 points)
Solved, I switch to use Read-File
by Stephen Pelc (3.4k points)
To answer your original question, you could take the definition of DATA-FILE from the kernel, strip out the GETPATHSPEC and use that as your basis. However, adding an unknown number of ALLOTs into the dictionary after compilation is not a good idea and is not recommended. Use one of the facetiously named words in Lib/Filehacks.fth.
...