I have an answer set program (verified to work) which I would like to run within a C# console application. I want to redirect the output of that program to a text file which I can then read from later on. I tried:
string directory = @"C:\...\Clingo";
string clingoPath = "clingo.exe";
string inputPath = "Assignment2.lp";
string dataPath = "Data1.lp";
string outputPath = "result.txt";
string arguments = String.Format("1 \"{0}\" \"{1}\" >\"{2}\"", inputPath, dataPath, outputPath);
// Set the necessary properties for the process
ProcessStartInfo clingoProcessInfo = new ProcessStartInfo(clingoPath, arguments);
clingoProcessInfo.WorkingDirectory = directory;
clingoProcessInfo.UseShellExecute = false;
// Start the process
Process clingoProcess = Process.Start(clingoProcessInfo);
However, when run, I get the following error: "***ERROR: (clingo): '>result.txt': could not open input file!"
I would like to know how to fix that.