Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » how to deal with "<",">" and ">>" ?
how to deal with "<",">" and ">>" ? [message #118390] Wed, 01 September 2004 10:31 Go to next message
Eclipse UserFriend
Originally posted by: Jack.wang.nicta.com.au

What can I do when running my C/C++ programme I want input some file such
as in command line "./execute /staff/phone < simple.xml"?
And if I want output to some file such as
"./execute /staff/phone < simple.xml >> output.txt" in command line?

I tried put them in "Arguments" block but seems not work.

Please help and thanks in advance.
Re: how to deal with "<",">" and ">>" ? [message #118595 is a reply to message #118390] Wed, 01 September 2004 12:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dejan.nu6.org

Hi Jack,
everything after "<" in your application command line is not in argv/argc.
Simply it's "shell business". If you want to "take" data, like in your
example, ./execute /staff/phone < simple.xml , than you simply fopen()
stdin, read from it, process it etc.
If you want something like:
../execute /staff/phone > simple.out
Than you simply do printf() because printf() is actually some form of
fprintf(stdout,...) (or maybe fputs() - i am not sure). So it is very, very
simple - you simply use fread(stdout, ...) to get data and printf(...) to
send data to standard output. SHELL is doing all those redirections and
streaming to some files...

Kind regards

--
Dejan Lekic
developer, sysadmin and DBA
http://dejan.lekic.org
Re: how to deal with "<",">" and ">>" ? [message #118806 is a reply to message #118595] Wed, 01 September 2004 21:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jack.wang.nicta.com.au

Hi Dejan

Thanx for bring me out from mixing C/C++ and Shell things.

I am just wondering that "<,>>,>" are so convenience and popular, why
don't we implement a function like that at "Run" of "Debug" block in
Eclipse platform.

Anyway, I love this IDE since my first sight on it.
Re: how to deal with "<",">" and ">>" ? [message #118917 is a reply to message #118806] Thu, 02 September 2004 08:45 Go to previous message
Eclipse UserFriend
Originally posted by: dejan.nu6.org

Eclipse is actually doing that - it redirects all output to stdin and stderr
from working application and puts it into proper place so you can see right
a way data which comes out...

Kind regards

Dejan

--
Dejan Lekic
developer, sysadmin and DBA
http://dejan.lekic.org
Previous Topic:How to integrate Qt
Next Topic:CDT 2.0.1 error ==> make handle_exceptions: Exception...
Goto Forum:
  


Current Time: Sat Jun 07 13:54:55 EDT 2025

Powered by FUDForum. Page generated in 0.03576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top