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;
    }
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
JGoforth
  • 83
  • 6

1 Answers1

0
E:\VobName\Sampledir

is a drive letter assign to a path. See the Windows command subst.
Did you try with the actual full path of the views?

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

or:

(dynamic view)
M:\myView\VobName\Sampledir
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • The paths in the original comment are the full paths. I have a partition (E:\\) that is dedicated to static views. – JGoforth Jan 24 '11 at 15:01
  • @JGoforth: no, it is not the full path. A snapshot view means: `:\aViewName\aVobName\someDirs`. To have a `VobName` directly following a drive letter means a `subst` has been done (through the ClearCase Explorer with a `View shortcut` for instance) – VonC Jan 24 '11 at 18:52