view test/octave.test/system/rename-1.m @ 2742:eeb061f9cdbf

[project @ 1997-02-26 04:29:07 by jwe]
author jwe
date Wed, 26 Feb 1997 04:29:48 +0000
parents
children 6ddb5a7f399e
line wrap: on
line source

from = tmpnam ();
to = tmpnam ();
id = fopen (from, "w");
if (id > 0 && fclose (id) == 0)
  [s, e] = stat (from);
  if (! e)
    if (rename (from, to) == 0)
      [s, e] = stat (from);
      if (e < 0)
      	[s, e] = stat (to);
      	e == 0
      	unlink (to);
      endif
    endif
  endif
endif