From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: Looking for configuration file format Date: Tue, 22 Mar 2022 12:01:35 +0000 Message-ID: <176D9F1F-6FEA-4D26-9F4E-137A639B74C6@ipfire.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7456381494970600494==" List-Id: --===============7456381494970600494== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, You could just remove the check for whether the key is numeric: https://git.ipfire.org/?p=3Dipfire-2.x.git;a=3Dblob;f=3Dconfig/cfgroot/gene= ral-functions.pl;h=3D6f49585dc6b4cae5818d1df54912458c464715f1;hb=3DHEAD#l879 I do not see it serving any purpose being strictly numeric. We could just tre= at the first value as the key no matter what it is. The only place where this could because a problem is when calling &findhashar= raykey() since that is enumerating all keys. -Michael > On 21 Mar 2022, at 20:12, Leo Hofmann wrote: >=20 > Hi Michael, >=20 > Thank you, I just tried it. As you suspected, General::readhasharray() acce= pts only numeric keys. >=20 > This format would work: > 1,logs.cgi/config.dat,configuration/logs/logsettings >=20 > But I need the path as a key, because I don't want to write a clumsy search= routine. > I'll wait for other suggestions and then build my own readmanualpages() if = needed! >=20 > Best regards, > Leo >=20 > Am 21.03.2022 um 20:29 schrieb Michael Tremer: >> Hey Leo, >>=20 >> Did you try &General::readhasharray()? >>=20 >> Then this file would just be a CSV file. >>=20 >> I believe that readhasharray might want a numeric key, but maybe it accept= s the first value as key whatever it is. >>=20 >> -Michael >>=20 >>> On 21 Mar 2022, at 19:27, Leo Hofmann wrote: >>>=20 >>> Hi all, >>>=20 >>> To fix an issue with the manualpages feature, I had planned to use this k= ey/value file format: >>>=20 >>> logs.cgi/config.dat=3Dconfiguration/logs/logsettings >>>=20 >>> But unfortunately this is not possible with the existing General::readhas= h() function, because it removes non-alphanumeric keys. >>>=20 >>> Before I write yet another readsomething() function: Is there a file form= at available somewhere in the IPFire CGIs that supports this? >>>=20 >>> Best regards, >>> Leo >>>=20 --===============7456381494970600494==--