Hello!
How can I execute other exe files from within a executable file in GCC.
In TurboC 3, the spawn command executes a file and returns command to
the calling file.
whereas in GCC, the exec command only starts the execution of the new
file and does not return command to the calling file (the calling file
is terminated on the start of execution of the called file)
Is there any command in GCC that after executing the called file,
returns command to the calling file. The called file should be able to
be run in both concurrently as well as putting the calling file on
hold.
Thank You
Casanova 9 3008
On Thu, 16 Dec 2004 08:17:23 -0800, Casanova wrote: Hello!
How can I execute other exe files from within a executable file in GCC. In TurboC 3, the spawn command executes a file and returns command to the calling file.
The standard C function to run external commands is called system() and is
declared in <stdlib.h>. If that won't do what you want (it probably will)
then a good newsgroup to discuss gcc is gnu.gcc.help, but note that gcc is
just a compiler, your question is really about what libraries you happen
to be using with it.
Lawrence
system()
--
Nick Keighley
In article <11**********************@z14g2000cwz.googlegroups .com>
Casanova <pr********@gmail.com> wrote: How can I execute other exe files from within a executable file in GCC.
See the comp.lang.c FAQ, question 19.27.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
On 16 Dec 2004 08:17:23 -0800, Casanova
<pr********@gmail.com> wrote: How can I execute other exe files from within a executable file in GCC. In TurboC 3, the spawn command executes a file and returns command to the calling file.
The only method specified in standard C is system().
whereas in GCC, the exec command only starts the execution of the new file and does not return command to the calling file (the calling file is terminated on the start of execution of the called file)
Is there any command in GCC that after executing the called file, returns command to the calling file. The called file should be able to be run in both concurrently as well as putting the calling file on hold.
No (it would be in the system library rather than in GCC itself, so
check about your system libraries). The conventional way to do it on
Unix is to fork(2) a process which then calls exec(3) to run the
program, while the original process wait(2)s for it to complete. Or you
can use popen(3) which allows you to write to the program's standard
input or read its standard output. But these are outside the standard C
specification (although they are in the POSIX specification so are
standard on systems which are conformant to that, like most Unix
systems).
[Note: numbers in parentheses like fork(2) refer to the man(1) section
numbers...]
Chris C
in system() i wont be able to pass parameters. I have to open a exe
file which has to take command line parameters.
And just in case this is relevant. I am programming for the windows
platform
Casanova <pr********@gmail.com> wrote: in system() i wont be able to pass parameters. I have to open a exe file which has to take command line parameters.
Well, you pass the whole command line, including the parameters, to
system().
And just in case this is relevant. I am programming for the windows platform
If this is relevant then you're off-topic here and you should better
ask in a MS programming group.
Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Casanova wrote: in system() i wont be able to pass parameters. I have to open a exe file which has to take command line parameters.
And just in case this is relevant. I am programming for the windows platform
Of course you can pass parameters - you can pass anything you like
in a text string. What is done with them is not dependant on the C
language, but on the shell which which you are actually
communicating. That is system dependant, and OT here.
--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
In article <sl******************@ccserver.keris.net>,
Chris Croughton <ch***@keristor.net> wrote:
.... The conventional way to do it on Unix is to fork(2) a process which then calls exec(3) to run the program, while the original process wait(2)s for it to complete. Or you can use popen(3) which allows you to write to the program's standard input or read its standard output. But these are outside the standard C specification (although they are in the POSIX specification so are standard on systems which are conformant to that, like most Unix systems).
All of which is clearly irrelevant to (and most likely to utterly confuse)
the OP, since s/he is clearly a Windoze dork.
[Note: numbers in parentheses like fork(2) refer to the man(1) section numbers...]
This, too.
On Fri, 17 Dec 2004 17:34:15 GMT, Kenny McCormack
<ga*****@yin.interaccess.com> wrote: In article <sl******************@ccserver.keris.net>, Chris Croughton <ch***@keristor.net> wrote: ...The conventional way to do it on Unix is to fork(2) a process which then calls exec(3) to run the program, while the original process wait(2)s for it to complete. Or you can use popen(3) which allows you to write to the program's standard input or read its standard output. But these are outside the standard C specification (although they are in the POSIX specification so are standard on systems which are conformant to that, like most Unix systems).
All of which is clearly irrelevant to (and most likely to utterly confuse) the OP, since s/he is clearly a Windoze dork.
If they are using GCC, as stated in the OP's question, they are likely
to have the rest of the libraries as well and be running with a
"Unix-like" environment such as Cygwin (under Windows) or DJGPP (under
MSDOS, likely since "Turbo C" was mentioned). [Note: numbers in parentheses like fork(2) refer to the man(1) section numbers...]
This, too.
Again, both Cygwin and DJGPP provide man.
Chris C This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: MAK |
last post by:
Hello everyone,
I know how to add images and icons etc to dll file.
What I would like to know is there is a way to add those icons on the forms
during the run time from the dll or to reference it ...
|
by: Wilk Teverbaugh |
last post by:
I've got an include file inside each page throughout my site. Inside this
include file I'm running server.execute to include other pages based on a
condition (userID).
The problem has two parts-...
|
by: Eric Wood |
last post by:
We have an application that is accessed using shared drives, client
executes program from server. We have already coded the program to
create and save the a bat file either locally on the users...
|
by: Randy Developer |
last post by:
Ok,
I've searched the web and newsgroups for a week now with no concrete
answer. Question: How, if possible, can you either navigate to or get a
listing of a directory to load on an asp page and...
|
by: tshad |
last post by:
I have an example I copied from "programming asp.net" (o'reilly) and can't
seem to get the Sub (writefile) to execute. It displays all the
response.write lines that are called directly, but not...
|
by: Eric Wood |
last post by:
We have an application that is accessed using shared drives, client
executes program from server. We have already coded the program to
create and save the a bat file either locally on the users...
|
by: sdb1031 |
last post by:
I am trying to run an exe within a python script, but I'm having
trouble with spaces in the directory name.
The following example will display the usage statement of the program,
so I know that...
|
by: Sam |
last post by:
My problem is that when I am trying to use
Server.Execute("Somehandler.ashx") I am getting HttpException.
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer,...
|
by: techgirl |
last post by:
Hi All-
I was wondering if anyone could help me with this issue. I am trying to run this 3rd party application called "CoreFTP.exe" from within C#. I have tested my code with "Notepad.exe" and...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |