Skip to content

Instantly share code, notes, and snippets.

@Jozkee
Created March 17, 2022 17:32
Show Gist options
  • Save Jozkee/c80c841eb6231a713094c8d6a85b0e72 to your computer and use it in GitHub Desktop.
Save Jozkee/c80c841eb6231a713094c8d6a85b0e72 to your computer and use it in GitHub Desktop.
TempWorkingDirectory
public class TempWorkingDirectory
{
string _directory;
public TempWorkingDirectory(string directory)
{
_directory = directory;
}
public void CreateFile(string filepath)
{
if (Path.IsPathRooted(filepath))
{
File.Create(filepath);
}
File.Create(Path.Combine(_directory, filepath));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment