C# library to Copy New and Modified directories/files

546 views Asked by At

I want to build an application that will copy all new and modified files from a source folder path to a destination backup path. I know I can use a brute force loop through all files in source directory and compare in destination directory (see code below). I was just wondering if there is a script out that that will accompplish this. I am more concerned with modified files then new files.

// all files
Directory.GetFiles(txtFolderPath.Text, "*", SearchOption.AllDirectories);


// last file modified time
FileSystemInfo.LastWriteTime(filepath)
0

There are 0 answers