Opening and Closing Binary Files
A binary file f has a Yorick data type which is distinct from
a text file. The info and print functions describe f.
The close function will be called implicitly when the last reference
to a file disappears, e.g.- if f is redefined.
|f = openb(filename)
||open filename read-only|
|f = updateb(filename)
||open filename read-write|
|f = createb(filename)
||create the binary file filename|
||close file f|
The data in a binary file is organized into named variables, each of
which has a data type and dimensions. The . operator, which extracts
members from a structure instance, accepts binary files for its left operand.
f = updateb("foo.bar");
print, f.var1, f.var2(2:8,::4);
f.var3(2,5) = 3.14;
Opens a file, prints var1 and a subarray of var2, sets
one element of var3, then closes the file.
The show command prints an alphabetical list of the variables
contained in a file:
show, f shows the variables in file f
f, pat show only names starting with pat
returns pointers to complete name lists for f