[TriLUG] c++ - how to rename files

Nathan Conrad conrad at bungled.net
Mon Dec 12 11:44:58 EST 2005


>From the manpage:

RENAME(2)                  Linux Programmer's Manual         RENAME(2)

NAME
       rename - change the name or location of a file

SYNOPSIS
       #include <stdio.h>

       int rename(const char *oldpath, const char *newpath);


-Nathan

On Mon, Dec 12, 2005 at 11:14:29AM -0500, Mark Freeze wrote:
> Can anyone throw me a tip and tell me how to rename files in a c++
> program?
> 
> What I want to do is have file1.txt renamed to file1_old.txt, then open
> file1_old.txt for input, and file1.txt for output.
> 
> Thanks,
> Mark.
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/



More information about the TriLUG mailing list