LinuxQuestions.org
Help answer threads with 0 replies.
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 02-22-2005, 09:43 AM   #1
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
Newbie: How to read/write conf/ini files?


Are there any system level functions (I do not want 3rd party libraries) to read conf/ini files? Thanks.
 
Old 02-22-2005, 09:54 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
In C? Besides the normal File I/O functions I don't believe so. I'm pretty sure you'll just have to read in the files and write your own parser. Lex and Yacc can help you do that if it is your goal.
 
Old 02-22-2005, 07:26 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
If you install the source code of an application that reads the configuration file, it will probably contain the Lex source files.

There are different types of configuration files. Some use the Windows 3.0 'inf' style. Others are actually mini-languages. The book "The Art of Unix Programming" by Eric Steven Raymond has a chapter dedicated to configuration files.

The book is now available on the web:
http://www.faqs.org/docs/artu/configurationchapter.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
smb.conf assistance on read/write server jer2eydevil88 Linux - Newbie 9 09-28-2005 08:26 PM
Example share in smb.conf doesn't work - read/write vs read only kleptophobiac Linux - Networking 0 09-01-2004 08:14 PM
difficulties with large files and system call read/write jwstric2 Programming 2 08-23-2004 12:42 AM
generic parser to read/write linux config files amitchandel Linux - Software 1 06-14-2004 05:00 PM
(Bash) Saving READ values in external .conf files spikylee Linux - Newbie 4 10-28-2003 07:46 AM

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

All times are GMT -5. The time now is 05:06 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