1
0
Fork 0
fgdata/Nasal/io.nas

9 lines
244 B
Text
Raw Normal View History

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