Branch: Tag:

1998-01-21

1998-01-21 19:36:58 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

varargs removed, Stdio.cp() added

Rev: lib/master.pike:1.63
Rev: lib/modules/Array.pmod:1.4
Rev: lib/modules/Process.pmod:1.15
Rev: lib/modules/Simulate.pmod:1.5
Rev: lib/modules/Stdio.pmod:1.9
Rev: lib/modules/Thread.pmod:1.10

259:    default: return ([])[0];    }   } +  + #if constant(system.cp) + constant cp=system.cp; + #else + #define BLOCK 65536 + int cp(string from, string to) + { +  string data; +  object tmp=File(); +  if(tmp->open(from,"r")) return 0; +  function r=tmp->read; +  tmp=File(); +  if(tmp->open(to,"wct")) return 0; +  function w=tmp->write; +  do +  { +  data=r(BLOCK); +  if(!data) return 0; +  if(w(data)!=strlen(data)) return 0; +  }while(strlen(data) == BLOCK); +  +  return 1; + } + #endif