public Stream OpenOutputWriteStream(string file) { var fullPath = Path.Combine(settings.OutDir, StringPathExtensions.TrimStartingPathChars(file)); var fullDir = Path.GetDirectoryName(fullPath); if (!Directory.Exists(fullDir)) { Directory.CreateDirectory(fullDir); } return(File.Open(fullPath, FileMode.Create, FileAccess.Write, FileShare.None)); }
public Stream OpenOutputParentWriteStream(string file) { var outDir = settings.OutDir; if (deploymentFolder != null) { //If using a deployment folder, get the parent folder. outDir = Path.GetDirectoryName(outDir); } var fullPath = Path.Combine(outDir, StringPathExtensions.TrimStartingPathChars(file)); var fullDir = Path.GetDirectoryName(fullPath); if (!Directory.Exists(fullDir)) { Directory.CreateDirectory(fullDir); } return(File.Open(fullPath, FileMode.Create, FileAccess.Write, FileShare.None)); }
public bool DoesOutputFileExist(String file) { var fullPath = Path.Combine(settings.OutDir, StringPathExtensions.TrimStartingPathChars(file)); return(File.Exists(fullPath)); }