writeRecord

Syntax

writeRecord(handle, object, [offset=0], [length])

Arguments

handle is a binary file handle.

object is a table or a tuple with array elements of equal sizes.

The optional parameter offset specifies the starting row position.

The optional parameter length indicates the number of rows to be written.

Details

Convert DolphinDB objects such as tables or tuples to binary files. The function returns with the number of rows written to handle.

Examples

$ t=table(1..10000 as id, 1..10000+100 as value);

$ f1=file("C:/DolphinDB/a.bin", "w");
$ f1.writeRecord(t);
10000

$ f2=file("C:/DolphinDB/b.bin", "w");
$ f2.writeRecord(t, 100, 1000);
1000

$ f3=file("C:/DolphinDB/c.bin", "w");
$ f3.writeRecord(t, 100, 10000);
The optional argument length is invalid.