This is regarding finding exe files in type

 string path = Environment.GetEnvironmentVariable("PATH");
 var modPath = string.Empty;
 string[] allPaths = path.Split(Path.PathSeparator);
 bool pathFound = false;
 foreach (string path2 in allPaths)
 {
     modPath = Path.Combine(path2, array[1]+".exe");
     if(File.Exists(modPath))
     {
         Console.WriteLine($"{array[1]} is {modPath}");
         {
             pathFound = true;
             break;
         }
     }
 }
 if (pathFound)
     continue;
 Console.WriteLine($"{command.Substring(5)}: not found");

When i am removing .exe everything is passing except1
remote: [your-program] my_exe is /tmp/bar/my_exe
remote: [tester::#MG5] ^ Line does not match expected value.
remote: [tester::#MG5] Expected: “my_exe is /tmp/quz/my_exe”
remote: [tester::#MG5] Received: “my_exe is /tmp/bar/my_exe”

so i changed it to exe strict,but its not working for any scenarios
why so

Hey @banerjeesabyasachi375-svg , could you double-check if your code implements the following logic?

Note that there are multiple files with the same name in different locations, but not all of them are executable. Only the first executable should be picked up.

@andy1li thats why i am giving .exe extension at the end of the path
but its failing for all,no test case passing

Thanks for the clarification ! A couple of things to note:

  1. None of the files in the tests actually have a .exe extension, and in fact they don’t have any extension at all.
  2. Instead of relying on file extensions (which is specific to Windows), it’s better to actually check whether the file has executable permissions.

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!