rename


rename

Renames or moves a file

 #include <stdio.h> int rename ( const char *oldname , const char *newname  ); 

The rename( ) function changes the name of the file specified by oldname to the string referenced by newname. The pointer argument oldname must refer to the name of an existing file.

The function returns 0 on success. If rename( ) fails to rename the file, it returns a nonzero value.

Example

See the example for remove( ) in this chapter.

See Also

freopen( ), remove( ), tmpnam( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net