Ecere SDK/eC Forums • View topic - Copy Folder/Directory Tree Contents

Ecere SDK/eC Forums

Ecere Developers Community

Copy Folder/Directory Tree Contents

Help with the Ecere cross platform system functionality: working with files, threads, timers, databases, etc.

Copy Folder/Directory Tree Contents

Postby naji » Fri Sep 23, 2011 1:27 pm

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.
Copying Folder/Directory Tree Contents Sample Project Example In Ecere
(1.45 KiB) Downloaded 1380 times
Posts: 3
Joined: Tue Mar 30, 2010 8:31 pm

Return to System Library

Who is online

Users browsing this forum: No registered users and 0 guests