Archived

This topic is now archived and is closed to further replies.

C++ Copy files

This topic is 5586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, i want to make a program to copy save game files to a floppy. Though the name of the save files are different on very comp, each save file has a letter at the start of the file name hich is always te same but has 5 different numbers after. Also what is the a function in C++ to copy files? Thanks.

Share this post


Link to post
Share on other sites
okay... try this funcs

FileFindFirst
FileFindNext (maybe it''s FindFileNext)

to cpoy a file there is a shell function SHFileOperation I guess... if you don''t want to use windows, you have to load it and the save it somewhere else manually I guess...

If you have problems constructing the filename, try something like

char buffer[1000];

sprintf(buffer,"x%05d.ext", number);

this could give you x00004.ext for number = 4

good luck

Share this post


Link to post
Share on other sites
Luckily the to files i need 2 copy are the only ons in th folder with .erc extensions . Although i don't really want to se Win32 just plain C++ .

[edited by - MattMcC on August 30, 2002 8:41:30 AM]

Share this post


Link to post
Share on other sites
You could always use

system("copy file1 a:");

or something like that... build up the command string using sprintf as Caesar said.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Share this post


Link to post
Share on other sites