Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - rename http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   rename

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

   Description
   Changes  the name of a file from oldname to newname. Both oldname  and
   newname may contain drive and path names but both names must refer  to
   the same drive.

   Example
   #include <stdio.h>
   #include <io.h>
   main()
   {
   int return_code;
   char *oldname,*newname;
        oldname = "data.fil";
        newname = "file.dat";
        return_code = rename(oldname,newname);
        printf("\n%s %s renamed to %s\n",oldname,
        return_code == 0 ? "was" : "was not",newname);
   }

   Return Value
   rename returns a 0 if the file name was successfully changed and  non-
   zero if it was not and errno is set.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson