let move_gate fname =
  let tmpfname=String.concat "." [fname;"tmp"] in 
    Unix.rename fname tmpfname;
    tmpfname