title: Invoke cygwin commands from my application, avoiding the DOS shell
body: <p>I like to scan a set of files using cygwin's "file" command. I like to invoke this command from within my own program.</p>
  
  <p>The program is written in REALbasic (RB), which is similar to Visual Basic (e.g. has similar ways to interface DLL APIs with the "declare" statement).</p>
  
  <p>RB comes with a Shell class that lets me invoke tools of the "DOS" command type. I understand that I could use that to invoke a cygwin shell (e.g. sh or bash, as suggested <a href="https://stackoverflow.com/questions/7513133/run-bash-command-in-cygwin-from-another-application">here</a>), which I then tell to invoke the "file" command. This seems rather inefficient to me as it would load the bash shell every time I want to invoke its file tool.</p>
  
  <p>However, I wonder if there's a dll that comes with a cygwin installation that provides a direct access to its command shell. By this I hope to speed things up as I could hopefully load its shell once, then just invoke the file cmd as needed.</p>
  
  <p>Maybe there's even a VB class that already does this, which I could then port to RB? I could not find anything like that yet, though.</p>