file_obj
Synopsis
file_obj(file, offset, type, columns, ascii_binary [,stride])
Description
The file_obj object reads an ASCII or a binary array from the file object. It starts reading data at the offset position which is specified in bytes, and it reads the number of values corresponding to the dimensionality of the referencing object. If the dimensionality is not specified, it reads until the end of file. If the dimensionality is specified and the end of file is reached before the target object is filled, an error is reported.
Note: file_obj is the superclass of the file_obj_bin, file_scalar_ascii, and file_array_ascii objects described later in this chapter.
Parameters
Object of type FILE.file that identifies the file that will be accessed. Note that this is not a string holding the filename.
An array of 1s and 0s that represents words in the lines of an ASCII file. It indicates whether or not to read the words. This parameter is not used for binary files.
0 for ASCII files, 1 for binary files and 2 for portable binary (XDR) files. Alternatively you can specify this parameter using one of the strings: "ascii", "binary" or "xdr".
An optional integer value that specifies how many "strides" must be taken to get to the next data value. The value is interpreted in terms of elements, not bytes. It is relevant only for binary files, if is omitted, 1 is assumed.1});
Example
v/dv_examp/file_ucd.v
v/dv_examp/file_unif.vFile
See also related modules