Code: Select all
void CopyFolderContents(char * indir, char * outdir)
{
FileListing listing { indir };
MakeDir(outdir);
while (listing.Find())
{
char location[MAX_LOCATION];
strcpy(location, outdir);
PathCat(location, listing.name);
if (listing.stats.attribs.isDirectory)
CopyFolderContents(listing.path, location);
else
{
File file = FileOpen(listing.path, read);
if (file)
{
file.CopyTo(location);
delete file;
}
}
}
}