0

I have a directory with 30 sub directory files in it "C:\School\Grad School (Comp Sci)\Thesis\Apps". How do I list all of the sub directories in SrcML.Net?

[TestCase]
public void CalculateSimpleProjectStats()
{
    var dataProject = new DataProject<CompleteWorkingSet>("Android Apps",
        Path.GetFullPath(@"C:\School\Grad School (Comp Sci)\Thesis\Apps\accelerometer-app-master"),
        "..//..//..//SrcML");
    Debug.WriteLine("Parsing android-pedometer-studio....");

    dataProject.UpdateAsync().Wait();

    NamespaceDefinition globalNamespace;
    Assert.That(dataProject.WorkingSet.TryObtainReadLock(5000, out globalNamespace));

    DisplaySensorTypes(globalNamespace);
    //DisplayWhetherAppIsUnitTested();           
    DisplayCallsToOnSensorChanged(globalNamespace);            
}
keenthinker
  • 7,645
  • 2
  • 35
  • 45
Marco Peterson
  • 81
  • 1
  • 1
  • 4
  • 2
    What happens when you run the above code? Do you get an error? If not, what are your results? You can edit your question to add this information. – Theresa Apr 09 '15 at 20:33

1 Answers1

0

You could use the GetDirectories method of the DirectoryInfo class:

var di = new DirectoryInfo("..//..//..//SrcML");
var subDirectories = di.GetDirectories();

The method will be called from the current directory, so it will automatically find the correct path.

If you want to retrieve all subdirectories (subdirectory of subdirectory and so on) from the SrcML directory, than have a look at the SO answer that @aquinas posted in his comment to you question.

Community
  • 1
  • 1
keenthinker
  • 7,645
  • 2
  • 35
  • 45