It creates comma separated files but not CSV. For example:
stream = new TextStream("/Users/welsh/Desktop/csvfile.csv","write",-2);
csv = new CsvWriter(stream,";","UTF-8");
tab = new Array("1","Amal","BAHOUS");
csv.writeRecord(tab);
tab = new Array("2","cool",'wow is "this" great');
csv.writeRecord(tab);
stream.close();
This generates:
1,Amal,BAHOUS
2,cool,wow is "this" great
That is not a valid CSV file. From the spec:
Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes
I also tried putting a comma in a field and that didn't get enclosed in double-quotes either.