The specification that if old and new refer to the same file is intended to guarantee that:Seems a little lame to me (the given rationale, not necessarily the behaviour).rename("x", "x");
does not remove the file.
All of the special handling for when the new file already exists is a POSIX extension of the ISO C standard.
In reply to Re: [OT] rename(2) -- renaming file to itself produces no error.
by ysth
in thread [OT] rename(2) -- renaming file to itself produces no error.
by dmitri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |