System()

N

nnandini8

Hello Friends,
I am trying to write a program that takes a command
line arguement and a input file.
I know that I can do this using system() but I am not able to
understand how to pass the file.

ex: "dnaml" is a command line arguement.
This asks for a input file known as "infile"

so how do i pass it in system() function

I tried system("dnaml infile")
which is of no use.

Any help is greatly appreciated

Cheers
Nandini
 
S

stefan.ciobaca

I'm afraid you're going to have to be more clear on the problem if you
expect an answer.
 
N

nnandini8

Sorry
Here is my problem.

when I type "dnaml" in command line and hit enter it asks for the file
name "infile". Now I need to pass "infile" when "dnaml" command
executes how do I do that

Any help is greatly appreciated


Cheers
Nandini
 
P

Phlip

nnandini8 said:
when I type "dnaml" in command line and hit enter it asks for the file
name "infile". Now I need to pass "infile" when "dnaml" command
executes how do I do that

system("echo infile | dnam1"); will work if dnam1 does not use any advanced
console techniques to read its input string.

Also, all of this stuff is off-topic except system() itself, so you will get
better results on a newsgroup covering your command line system (CMD.EXE,
bash, etc.).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top