2

I am attempting to get the list of view privates in a particular directory from within a C# application.
I am using the function below to make that call with:

ClearCommand = "ls -r -view_only" 

and

directory = @"E:\VobName\sampleDir". 

It returns:

cleartool: Error: Pathname is not within a VOB: "E:\VobName\Sampledir"

If I do the same command in the windows command prompt from within E:\VobName\sampleDir, it works fine.
Any idea as to why there would be this inconsistency in the way it runs?


Here is the relevant code:

    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 回答