Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can we invoke a script in a C++ program/method?

Status
Not open for further replies.

micotao

Programmer
Jun 16, 2004
33
CN
Hi, All:
Here I have a question, suppose we have a C++ based module, can we design a class method for the C++ program in which we invoke another external shell script to finish some function? It is feasible?
Any hints or suggestions are highly welcomed.
 
Hi,

at least in C you can use system();
for example I have a small program, wich is the `shell' for some users (they need only FTP transfer)

Code:
#include <stdlib.h>
int main()
{
        return system("cd /cad_projects; /usr/bin/lftp ftp.asite.com");
}

___
____
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top