public static bool ContainsVolumes() { var vols = vFS.GetVolumes(); foreach (var vol in vols) { return(true); } return(false); }
public static bool CheckVolumes() { var volumes = vFS.GetVolumes(); foreach (var vol in volumes) { return(true); } return(false); }
public static bool ContainsVolumes() { if (vFS.GetVolumes().Count == 0) { return(false); } else { return(true); } }
// get volumes public static List <Sys.FileSystem.Listing.DirectoryEntry> GetVolumes() { return(Driver.GetVolumes()); }
protected override void BeforeRun() { //Init the file system var fs = new CosmosVFS(); VFSManager.RegisterVFS(fs); Console.Clear(); //Find the location where we booted from string boot = ""; bool frame = false; foreach (var item in fs.GetVolumes()) { Console.WriteLine("Found volume: " + item.mFullPath); foreach (var d in Directory.GetDirectories(item.mFullPath)) { Console.WriteLine("dir: " + d); } foreach (var d in Directory.GetFiles(item.mFullPath)) { Console.WriteLine("file: " + d); } if (File.Exists(item.mFullPath + "TESTAPP.DLL") | File.Exists(item.mFullPath + "dotnetparser.exe")) { Console.WriteLine("Found boot volume: " + item.mFullPath); boot = item.mFullPath; } if (Directory.Exists(item.mFullPath + "framework")) { frame = true; } else if (Directory.Exists(item.mFullPath + "FRAMEW")) { frame = false; } } if (boot == "") { Console.WriteLine("Cannot find the media that we booted from."); return; } try { byte[] fi = TestApp.file; if (File.Exists(boot + @"TESTAPP.DLL")) { fi = File.ReadAllBytes(boot + @"TESTAPP.DLL"); } else if (File.Exists(boot + @"DotNetparserTester.exe")) { fi = File.ReadAllBytes(boot + @"DotNetparserTester.exe"); } var fl = new DotNetFile(fi); var clr = new DotNetClr(fl, frame ? boot + @"framework" : boot + @"FRAMEW"); //Register our internal methods clr.RegisterCustomInternalMethod("TestsComplete", TestsComplete); clr.RegisterCustomInternalMethod("TestSuccess", TestSuccess); clr.RegisterCustomInternalMethod("TestFail", TestFail); clr.Start(); Console.WriteLine("Program exec complete."); } catch (Exception x) { Console.WriteLine("Caught error: " + x.Message); } }