b = file.write(a<,l>)
file.write(<f>) = l

Write a list to a file.

If a file pointer is not provided, then writes to the last opened file.

If called on get, then a list must be provided as an argument (after any optional file pointer). All entries in that list are written to the file. btrue is returned.

If called on assignment, then the assignment value is assumed to be a list that is written to the file.

Returns:b - true
Accepts:l - A list to write to the file
Arguments:a - An optional file pointer indicating what file to write to. l - A list argument when called on get only that is written to the file.

Usage Example

The following example illustrates how file.write can be used

model new
zone create brick size 2 2 2
fish define output_gps
    local f ="gps.txt","write","text")
    local l = list
    loop foreach local g gp.list
        local a ="%1,%2,%3,%4",, ...
                       gp.pos(g)->x, gp.pos(g)->y, gp.pos(g)->z)
        l = list.append(l,a)