home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / henkyaku1.0.exe / henkyaku / Program / Kernel / IO / FileWriter.tonyu < prev    next >
Text File  |  2002-05-18  |  567b  |  37 lines

  1. extends Object;
  2.  
  3. native _n_FileWriter;
  4. constructor FileWriter(fn) {
  5.    _body=_n_FileWriter (_body,fn);
  6. }
  7.  
  8. native _n_close;
  9. function close() {
  10.    if (!_body) return;
  11.    _n_close (_body);
  12.    _body=0;
  13. }
  14.  
  15. destructor destroy() {
  16.   close();
  17. }
  18.  
  19. native _n_write;
  20. function write(d) {
  21.    if (!_body) return null;
  22.    return _n_write (_body,d);
  23. }
  24.  
  25. native _n_writeLn;
  26. function writeStr(s) {
  27.    if (!_body) return null;
  28.    return _n_writeLn (_body,s);
  29. }
  30.  
  31. function writeLn(s) {
  32.    writeStr(s+"\r\n");
  33. }
  34.  
  35. function error() {
  36.    return (_body==0);
  37. }