Rename (C)

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire

rename is a function in the C programming language that renames a certain file.

The prototype of the function is:

int rename(const char *oldname, const char *newname)

Zero is returned upon success, and other integers are returned upon failure.

The rename function is specified in the stdio.h library header file in C and the cstdio header in C++. It is specified in ANSI C.

In POSIX, rename will fail (with EXDEV) if the old and new names are on different mounted file systems.[1] On Linux, if a call to rename succeeds it is guaranteed to have been atomic from the point of view of the current host.

References

  1. ^ rename: rename a file – System Interfaces Reference, The Single UNIX® Specification, Issue 6 from The Open Group

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net