3bcfb0624a
stuff is, for the most part, already available in the geo module; but it's small and this naming matches the evolvoing "standard nasal library".
8 lines
244 B
Text
8 lines
244 B
Text
# Reads and returns a complete file as a string
|
|
var readfile = func(file) {
|
|
if((var st = stat(file)) == nil) die("Cannot stat file: " ~ file);
|
|
var sz = st[7];
|
|
var buf = bits.buf(sz);
|
|
read(open(file), buf, sz);
|
|
return buf;
|
|
}
|