LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-24-2004, 10:17 AM   #1
C++Boar
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo
Posts: 68

Rep: Reputation: 16
redirect into C++ without a file ?


I am quite new to linux, but I have been thinking about doing some gui-programming for some commandline-programs that has no gui (and could use it).

This is not the case but if I wanted to make a grafical ls program I could write something like

system("ls > result.temp")
... read from result.temp
... show gui with result.tmp

But I don't want to create a (temporary) and read from it ...

I could also try something like
system("mycommand --output | ls")
but that would just create a new process and I need someway to signal the output into the old process. (?)

And all I want to do is the simple thing like
char buffer [large]; (or maybe string)
system ( ls > buffer )

Am I overlooking a very simple solution here ?
Hope somebody will/can help me.

C++Boar
 
Old 04-24-2004, 10:20 AM   #2
kooch
Member
 
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77

Rep: Reputation: 15
depends on what you need exactly but:
man pipe
man fifo

might be enlightening
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 08:10 AM
Using > to redirect to file DaHammer Programming 4 08-07-2005 12:05 AM
how do i redirect stderr to a file? nodger Programming 5 11-28-2004 11:22 AM
How do I redirect something to a file without it overwriting the destination file??? nikold01 Linux - General 8 09-09-2004 02:30 PM
Redirect to file (after startup) podollb Linux - Software 0 05-27-2004 05:29 PM


All times are GMT -5. The time now is 11:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration