• Post Reply Bookmark Topic Watch Topic
  • New Topic

discover Runtime program list / exec autocomplete  RSS feed

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm currently experimenting to create a console application that can emulate a shell environment. I'm stuck with COMMAND AUTO COMPLETION!

I can execute commands on runtime via


Obviously, the command I want to execute must be in the PATH.
but how can I get a list of all available commands in this PATH? I've got the code to do auto completion if I have got all possible command in a List. But I don't know how to populate this list (easily?)

Is there no other way to do this, other than actually scouring the directories and looking for executables name (i.e indexing them beforehand?)

Is it possible to reuse the auto-completion facility that the shell have already? I.e sending a keyboard <tab> into the shell from the java program and obtaining the result back?

Sorry been doing too much Java EE so my GUI skills need some brushing up.

Thanks for your help.

Regards,
Zen
[ November 28, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!