2

アプリケーション内から特定のディレクトリにあるビュー プライベートのリストを取得しようとしてい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;
    }
4

1 に答える 1

0
E:\VobName\Sampledir

パスに割り当てるドライブ文字です。Windows コマンドsubstを参照してください。
ビューの実際のフルパスを試しましたか?

(snapshot view)
C:\path\to\myView\VobName\Sampledir

また:

(dynamic view)
M:\myView\VobName\Sampledir
于 2011-01-20T21:02:48.960 に答える