Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What c lib to use when I need to parse a simple config file under linux? [closed]

Tags:

c

linux

Let's say I have a simple config file that my c program needs to read/parse.

Let's say it looks a little bit like this:

#Some comment key1=data1 key2=data2 

Is there a standard c lib that I can use instead of writing my own parser?

Thanks Johan


Note: Today I have my own little parser, but there must be some standard libs that solves this simple problem.

like image 899
Johan Avatar asked Feb 12 '10 09:02

Johan


People also ask

How read config file in Linux?

conf file in Linux, first locate it in the file system. Most often, the dhclient. conf file will be located in the /etc or /etc/DHCP directory. Once you find the file, open it with your favorite command-line editor.

Which directory is used to store configuration files in Linux?

The directory system categorizes all installed files. All configuration files are in /etc , all binary files are in /bin or /usr/bin or /usr/local/bin .

What is .conf file?

A CONF file is a configuration or "config" file used on Unix and Linux based systems. It stores settings used to configure system processes and applications. CONF files are similar to . CFG files found on Windows and Macintosh systems.


1 Answers

libconfig but it does quite more than what you're asking

like image 143
f4. Avatar answered Sep 18 '22 12:09

f4.