LinuxQuestions.org
Help answer threads with 0 replies.
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-17-2004, 09:04 AM   #1
gold5angel
LQ Newbie
 
Registered: Mar 2004
Location: China
Posts: 20

Rep: Reputation: 0
C Popen


Dear all,
Now, I want to change the command in C++ Linux "popen" into another command with the same function.
Because when I use "popen", it spends a lot of time to load.

Please suggest something, help me!!!
Thanks,
 
Old 04-17-2004, 12:02 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
I guess the problem is not in popen(), but maybe in the command you are running, or maybe you are using it incorrectly. Could post the relevant piece of code?
 
Old 04-17-2004, 07:07 PM   #3
TedMaul
LQ Newbie
 
Registered: Jan 2004
Location: UK
Distribution: LFS
Posts: 15

Rep: Reputation: 0
popen() buffers i/o by default, which could be the problem. Change it to unbuffered using setvbuf() (or something like that), or just do it manually with fork()/exec()/{read()|write()}
 
  


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
popen for windows csfalcon Programming 6 11-30-2005 08:21 AM
popen output not appear dimsh Programming 4 10-22-2005 02:56 AM
where do i get a bidirectional popen pipe? Thinking Programming 9 10-21-2005 07:42 AM
Multithreading and os.popen in wxPython wapcaplet Programming 0 12-29-2004 07:58 PM
popen read and write (both) how C++Boar Programming 2 07-05-2004 01:19 PM


All times are GMT -5. The time now is 12:51 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