1
0
Fork 0
fgdata/Nasal/io.nas
andy 3bcfb0624a Add soft-coded utilites to the "io" and "math" modules. The math
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".
2007-03-29 22:09:25 +00:00

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;
}