public void Copy(string sourceFileName, string destFileName) { if (Path.IsPathRooted(sourceFileName) || Path.IsPathRooted(destFileName)) { Directory.CreateDirectory(Path.GetDirectoryName(destFileName)); File.Copy(sourceFileName, destFileName); } else { _impl.Copy(sourceFileName, destFileName); } }
public void Copy(string sourceFileName, string destFileName) { if (Path.IsPathRooted(sourceFileName) || Path.IsPathRooted(destFileName)) { var dir = Path.GetDirectoryName(destFileName); if (!string.IsNullOrEmpty(dir)) { Directory.CreateDirectory(dir); } File.Copy(sourceFileName, destFileName, true); File.SetAttributes(destFileName, FileAttributes.Normal); } else { _impl.Copy(sourceFileName, destFileName); } }