int rename(string source, string dest) Renames a file from to . Works also for directories. If file is not in the same directory, it will be moved to the new path. Returns 1 if an error occurs, 0 if successful.