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 ( ' ' ) ; 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 ) ; }
Writes a seq of ? in a CSV format to the file specified