Skip to content

Instantly share code, notes, and snippets.

@borismod
Last active August 29, 2015 14:26
Show Gist options
  • Select an option

  • Save borismod/9b54d63c1f25a933dc0a to your computer and use it in GitHub Desktop.

Select an option

Save borismod/9b54d63c1f25a933dc0a to your computer and use it in GitHub Desktop.
using System.IO;
public class LegacyFileCopier
{
public void CopyFile(string sourceFilePath, string destinationDirectoryPath)
{
if (!Directory.Exists(destinationDirectoryPath))
{
Directory.CreateDirectory(destinationDirectoryPath);
}
var fileName = Path.GetFileName(sourceFilePath);
var destFileName = Path.Combine(destinationDirectoryPath, fileName);
File.Copy(sourceFilePath, destFileName);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment