Page 1 of 1

Copy Folder/Directory Tree Contents

PostPosted: Fri Sep 23, 2011 1:27 pm
by naji
Here is a function you can use in the Ecere SDK, eC programming language to copy the contents of a folder to another folder. Thanks to Jerome for the code.

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

Feel free to try out this sample program which tests the function.