Any available code to read configuration details from file ?

This is a discussion on Any available code to read configuration details from file ? within the Linux Programming forums, part of the Platform Specific Boards category; would like to write a module in order to read a configuration from the file ? example: [MODULE] prop1=<value> prop2=<value> ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    8

    Any available code to read configuration details from file ?

    would like to write a module in order to read a configuration from the file ?
    example:
    [MODULE]
    prop1=<value>
    prop2=<value>

    [MODULE1]
    prop1=<value>
    prop2=<value>


    I still can write in C program with basic parsing logic, but if there are any nice logic that is available in linux is really grt8. Or any application that uses parsing logic also fine. Could someone point out such a code ?

    Regards,
    JGtech.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    For some reason, I had thought GNU had a tool for this; a search for it didn't find one, but it did find libconfig - C/C++ Configuration File Library instead.

    EDIT: Think I was thinking of http://directory.fsf.org/project/libopts/
    Last edited by tabstop; 06-27-2011 at 10:09 AM.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,443
    glib also has similar capabilities: Key-value file parser, along with a lot of other, helpful stuff.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. code read file *.prc
    By kimlong008 in forum C Programming
    Replies: 2
    Last Post: 10-21-2010, 07:12 AM
  2. configuration file
    By mick3339 in forum C Programming
    Replies: 1
    Last Post: 08-02-2010, 12:16 AM
  3. Replies: 12
    Last Post: 05-29-2008, 11:36 AM
  4. read file details
    By kodithuwa in forum C Programming
    Replies: 1
    Last Post: 11-04-2007, 11:27 PM
  5. Configuration File
    By gvector1 in forum C# Programming
    Replies: 0
    Last Post: 07-24-2003, 11:26 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21