Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2000 13:21:42 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Zhihui Zhang <zzhang@cs.binghamton.edu>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: library routine used to read a configuration file
Message-ID:  <20000315132141.B89809@hades.hell.gr>
In-Reply-To: <Pine.GSO.3.96.1000314115751.15126A-100000@sol.cs.binghamton.edu>; from zzhang@cs.binghamton.edu on Tue, Mar 14, 2000 at 11:59:28AM -0500
References:  <Pine.GSO.3.96.1000314115751.15126A-100000@sol.cs.binghamton.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 14, 2000 at 11:59:28AM -0500, Zhihui Zhang wrote:

> I need to write a daemon that reads a configuration file when it
> starts.  Is there any library routines that can help me on this?

The short answer: no.

The longer answer:
There are infinite ways of writing a config file.  Clearly, there can
only be a finite number of functions in the system libraries.

I think you can roll your own, based around a simple line-reader
function.  If you're even more mad than that, you can browse the sources
of FreeBSD to see how programs like /bin/sh read their startup files, or
even how programs like fetchmail (from the ports) parse their config
file with flex!

Too many ways to skin a cat,
Ciao.

- Giorgos Keramidas


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000315132141.B89809>