Created
March 17, 2022 17:32
-
-
Save jozkee/c80c841eb6231a713094c8d6a85b0e72 to your computer and use it in GitHub Desktop.
TempWorkingDirectory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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