public static void CopyDir(string srcDirName, string destDirName, CopyDirPreCopyDelegate preCopy, bool ignoreError, bool printStatus, bool skipIfNoChange, bool deleteBom, bool useTimeStampToCheckNoChange) { string[] files = Directory.GetFiles(srcDirName, "*", SearchOption.AllDirectories); foreach (string srcFile in files) { FileInfo info = new FileInfo(srcFile); string relativeFileName = IO.GetRelativeFileName(srcFile, srcDirName); string destFileName = Path.Combine(destDirName, relativeFileName); string destFileDirName = Path.GetDirectoryName(destFileName); if (preCopy != null) { if (preCopy(info) == false) { continue; } } try { if (Directory.Exists(destFileDirName) == false) { Directory.CreateDirectory(destFileDirName); } FileCopy(srcFile, destFileName, skipIfNoChange, deleteBom, useTimeStampToCheckNoChange); } catch { if (ignoreError == false) { throw; } } if (printStatus) { Con.WriteLine(relativeFileName); } } }
public static void CopyDir(string srcDirName, string destDirName, CopyDirPreCopyDelegate preCopy, bool ignoreError, bool printStatus, bool skipIfNoChange, bool deleteBom) { CopyDir(srcDirName, destDirName, preCopy, ignoreError, printStatus, skipIfNoChange, deleteBom, false); }
public static void CopyDir(string srcDirName, string destDirName, CopyDirPreCopyDelegate preCopy, bool ignoreError, bool printStatus) { CopyDir(srcDirName, destDirName, preCopy, ignoreError, printStatus, false, false, false); }