[TriLUG] c++ - how to rename files

Brian Henning brian at strutmasters.com
Mon Dec 12 12:01:46 EST 2005


Ah, UNIX.  Where in the shell, you use mv to rename a file, and in C you 
use rename to move a file.

Makes my day. :)

~B


Owen Berry wrote:
> 'man 2 rename' should tell you all you need to know.
> 
> Owen
> 
> On Mon, 2005-12-12 at 11:14 -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.
> 
> 

-- 
----------------
Brian A. Henning
strutmasters.com
336.597.2397x238
----------------



More information about the TriLUG mailing list