- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: C: How to pull in info from the system?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2014 09:57 PM
08-15-2014 09:57 PM
Hello Everyone;
I want to run the <apm> command, from withing a C program, and get the program to receive the output - so that I can display it in an xsession (window) on my screen.
I've used the <system> call to tell the O/S what to do - but I don't know where to look to find out how to issue a system call and have the program receive the output.
Any ideas are appreciated.
regards,
tonyp
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2014 01:34 AM
08-16-2014 01:34 AM
SolutionThe correct function is popen(3) with the "r" parm. Or you could use pipe(2) with fork(2)/exec(2).
And example of the reverse popen(3) is here:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2014 04:03 PM
08-16-2014 04:03 PM
Re: C: How to pull in info from the system?
Hello Dennis;
All I needed was the <popen> function.
Worked as expected.
Now I can re-write all the programs that I wrote that use [system abcdefg >> output] and then do an <open> of "output".
The link you left was a bonus!
Thank you for your help!
regards,
tonyp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2014 06:27 PM
08-16-2014 06:27 PM
Re: C: How to pull in info from the system?
>Thank you for your help!
If the posts were helpful, please click on the kudos stars, both here and at the link.