FLTK logo

RE: [fltk.general] OT: How to send system call to memory not file

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

RE: OT: How to send system call to memory not file "MacArthur, Ian (SELEX) (UK)" Aug 15, 2005  
 
> Sorry for the OT but I'm sure you guys are good at this. If I want to
> send the output of
>
> ps -aux > /tmp/file
>
> to a memory sstream instead of a file is there any way to do
> it in C++?

Not entirley sure I understood the question, but I *think* popen() might be the answer anyway...!

So something like (caution: from memory...)

	fd = popen("ps -aux", "r");

Ought to return a stream you can read from. Probably. I think.
Not C++ as such, but you can "do it in C++"...

Also - not sure how well popen() works on win32, I have used it sometimes and it's been OK, but I have heard bad reports... don't know if that matters to you though?
--
Ian

********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************


Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.