code: public static Value fwriteval(Value fval, Value tval, Value dval)
  	{
  		File file = getFile(fval);
  		String fdir = dval.toString(); // <start>|<append>
  		StringBuffer text = new StringBuffer();
  		if (tval instanceof SeqValue)
  		{
  			for (Value val : ((SeqValue) tval).values)
  			{
  				text.append(val.toString());
  				text.append(",");
  			}
  
  		}
  
  		if (text.length() > 0 && text.charAt(text.length() - 1) == ',')
  		{
  			text.deleteCharAt(text.length() - 1);
  		}
  		text.append('\n');
  
  		try
  		{
  			FileOutputStream fos = new FileOutputStream(file, fdir.equals("<append>"));
  
  			fos.write(text.toString().getBytes(Console.charset));
  			fos.close();
  		} catch (IOException e)
  		{
  			lastError = e.getMessage();
  			return new BooleanValue(false);
  		}
  
  		return new BooleanValue(true);
  	}
docs: Writes a seq of ? in a CSV format to the file specified
  
  @param fval
  the filename
  @param tval
  the sequence to write
  @param dval
  append to or start a new file
  @return