• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

invoking other programs

I want to write a program that would invoke other commands on the system (ex: dir (dos) or ls(unix)). Can someone give me a hint on how to get this done? Thanks in advance.
0
ken2
Asked:
ken2
  • 2
  • 2
1 Solution
 
nietodCommented:
The only portable way is to use the system() function which is part of the C run-time library.  There are some non-portable ways that may provide you with more control/options however.

Let me know if you have questions.
0
 
jkrCommented:
Hi nietod - you're typing fast ;-)
Well, this usually can be done using the 'system()' command.
However, if you specialize on a certain platform (e.g. UN*X, NT, Win9x) there are eventually more sophistcated wayd to do this (NOTE: 'dir' in DOS is a built-in shell command, you'll have to use the command line 'command.com /k dir').
0
 
nietodCommented:
>> Hi nietod - you're typing fast ;-)
Quit complaining.  I was gone for 4 days, you had ample time to make it to the top.  : - )
0
 
jkrCommented:
nietod - did i complain <lol> ?
Not at all!!! ;-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now