アプリケーション内から特定のディレクトリにあるビュー プライベートのリストを取得しようとしていC#
ます。
以下の関数を使用して、次の呼び出しを行います。
ClearCommand = "ls -r -view_only"
と
directory = @"E:\VobName\sampleDir".
戻り値:
cleartool: Error: Pathname is not within a VOB: "E:\VobName\Sampledir"
内から Windows コマンド プロンプトで同じコマンドを実行すると、正常にE:\VobName\sampleDir
動作します。
実行方法にこの矛盾がある理由について何か考えはありますか?
関連するコードは次のとおりです。
private String RunCommand(String clearCommand, String directory)
{
String retVal = String.Empty;
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cleartool";
startInfo.Arguments = clearCommand;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.WorkingDirectory = directory;
try
{
// Start the process with the info we specified.
// Call WaitForExit and then the using statement will close.
using (Process process = Process.Start(startInfo))
{
//exeProcess.WaitForExit();
// Read in all the text from the process with the StreamReader.
using (StreamReader reader = process.StandardOutput)
{
retVal = reader.ReadToEnd();
}
if (String.IsNullOrEmpty(retVal))
{
// Read in all the text from the process with the StreamReader.
using (StreamReader reader = process.StandardError)
{
retVal = reader.ReadToEnd();
}
}
}
}
catch
{
Debug.Assert(false, "Error sending command");
}
return retVal;
}