LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-25-2004, 08:39 AM   #1
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Rep: Reputation: 30
Catching sections in .conf files with C++


I want to add some text in the XF86Config file in the section of "Files".Are there any libraries there to do that or some other way ? And how can I execute a command from a C++ program ? For example, tar zxvf somefile.tar.gz ?

Thanks in advance
 
Old 04-25-2004, 09:04 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Re: Catching sections in .conf files with C++

Quote:
Originally posted by gamehack
And how can I execute a command from a C++ program ? For example, tar zxvf somefile.tar.gz ?
See:
man 3 system
man 3 exec
man 3 popen

Use system() if you just want to execute a program.
Use popen if you need to talk to the stdin/stdout of the command you run from your program.
Use execl() / execlp() / execle / execv() / execvp() if you want to exti your program and run another instead.
 
Old 04-25-2004, 11:10 AM   #3
gamehack
Member
 
Registered: Jun 2003
Location: Sevenoaks, UK
Distribution: Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
Thank you Hko.And doesn't anybody have some information about the sections ?
 
Old 05-16-2006, 08:48 AM   #4
WhiskeyTangoFoxtrot
Member
 
Registered: Oct 2005
Location: Windsor, Ontario, Canada
Distribution: Fedora Core 5,4,3 & Ubuntu 6.06, 8.10
Posts: 403
Blog Entries: 1

Rep: Reputation: 30
well im trying a simirial thing, with the Xorg.conf file. still in the process of figuring it out but heres what we have been able to figure out uptil now
http://www.linuxquestions.org/questi...d.php?t=443874
 
  


Reply



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
how can I get these sections in Tasksel? kuertensun Debian 1 06-29-2005 08:31 PM
Linker Sections DylanDylan Linux - General 0 07-19-2004 04:26 AM
SUSE 9.1: named.conf works, but including separate conf files doesn't??? registering Linux - Distributions 0 06-09-2004 04:03 PM
Tutorial sections Gill Bates LQ Suggestions & Feedback 10 10-16-2003 04:07 PM
Bind and DNS information conf files and zone files aaronluke Linux - General 1 10-13-2002 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration