Thread: .ini parsing

.ini parsing

From
sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Date:
Psqlodbc 7.2.5 isn't able to parse the .ini files produced by common
.ini files creation programs, such as that shipped with iODBC.  The
reason is that it cannot deal with spaces before the "=" signs.  So,

Port= 5432

is OK, but

Port = 5432

is not.  I think it would save a lot of confusion if this were fixed
or at least a FAQ would talk about it.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Re: .ini parsing

From
Giuliano Gavazzi
Date:
At 22:03 +0100 2003/03/19,  (Michael Sperber [Mr.
  Pre wrote:
>  >>>>> "Giuliano" == Giuliano Gavazzi <> writes:
>Giuliano> strange. I use iODBC and it is fine with the spaces.
>Besides, are you
>Giuliano> sure the odbc.ini is read by the driver and not by the iodbc driver
>Giuliano> manager? You see, with the old version of iODBC on MacOSX the .ini
>Giuliano> files were actually named differently and had a different location,
>Giuliano> either the driver manager was passing the file location to
>the driver,
>Giuliano> or, as I said above, the files were read by the iODBC driver manager
>Giuliano> indeed.
>Giuliano> Maybe this is a bug with the version of iODBC you are using.
>
>No; iODBC parses the .ini file just fine, with spaces.  It's the
>psqlodbc driver that doesn't.  (I'll be glad to provide details, but
>I've actually debugged and read the code in question to figure this
>out.  It's pretty obvious from looking at the code.)
>

It might be obvious, but then can you tell me why I haven't got any
problems here?

One thing I forgot to say is that I haven't got any Port = 5432 parameter line.

Giuliano

Re: .ini parsing

From
Giuliano Gavazzi
Date:
At 8:25 +0100 2003/03/20,  (Michael Sperber [Mr.
  Pre wrote:
>  >>>>> "Giuliano" == Giuliano Gavazzi <> writes:
[...]
>Giuliano> It might be obvious, but then can you tell me why I haven't got any
>Giuliano> problems here?
>
>How am I supposed to know?  Why are you being so abrasive?  I'm trying
>to help you guys here.

sorry! I was just asking because you say that it is clear from the
code, but if it clear from the code why is it working on my system
(MacOSX)?
I realise that the rest of my argument did not make much sense - the
one regarding the changed name of the ini file in the last version of
iODBC for MacOSX, as the driver manager does presumably read the
parameters and passes them in the connection string to the driver. It
might well be that the MacOSX version of the driver manager sanitises
the connection string eliminating those extra spaces. I do not know
if these extra spaces are acceptable in the standard, if they are not
then the bug is in iODBC (not for MacOSX)..
Ok, this is probably the answer to why I do not see any problems..
Oh, and I also was trying to help you!

I do not know if these extra spaces are acceptable in the standard,
if they are not then the bug is in iODBC (not for MacOSX)..

Giuliano

Re: .ini parsing

From
Giuliano Gavazzi
Date:
At 16:35 +0100 2003/03/19, sperber@informatik.uni-tuebingen.de
(Michael Sperber [Mr.
  Pre wrote:
>Psqlodbc 7.2.5 isn't able to parse the .ini files produced by common
>.ini files creation programs, such as that shipped with iODBC.  The
>reason is that it cannot deal with spaces before the "=" signs.  So,
>
>Port= 5432
>
>is OK, but
>
>Port = 5432
>
>is not.  I think it would save a lot of confusion if this were fixed
>or at least a FAQ would talk about it.

strange. I use iODBC and it is fine with the spaces. Besides, are you
sure the odbc.ini is read by the driver and not by the iodbc driver
manager? You see, with the old version of iODBC on MacOSX the .ini
files were actually named differently and had a different location,
either the driver manager was passing the file location to the
driver, or, as I said above, the files were read by the iODBC driver
manager indeed.
Maybe this is a bug with the version of iODBC you are using.

Giuliano
--
H U M P H
    || |||
  software

Java & C++ Server/Client/Human Interface applications on MacOS - MacOS X
http://www.humph.com/

Re: .ini parsing

From
sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Date:
>>>>> "Giuliano" == Giuliano Gavazzi <dev+pgsql@humph.com> writes:

Giuliano> At 22:03 +0100 2003/03/19,  (Michael Sperber [Mr.
Giuliano>   Pre wrote:
>>  >>>>> "Giuliano" == Giuliano Gavazzi <> writes:
Giuliano> strange. I use iODBC and it is fine with the
>> spaces. Besides, are you
Giuliano> >Giuliano> sure the odbc.ini is read by the driver and not by the iodbc driver
Giuliano> >Giuliano> manager? You see, with the old version of iODBC on MacOSX the .ini
Giuliano> >Giuliano> files were actually named differently and had a different location,
Giuliano> either the driver manager was passing the file location to
>> the driver,
Giuliano> >Giuliano> or, as I said above, the files were read by the iODBC driver manager
Giuliano> >Giuliano> indeed.
Giuliano> >Giuliano> Maybe this is a bug with the version of iODBC you are using.
Giuliano> >
Giuliano> >No; iODBC parses the .ini file just fine, with spaces.  It's the
Giuliano> >psqlodbc driver that doesn't.  (I'll be glad to provide details, but
Giuliano> >I've actually debugged and read the code in question to figure this
Giuliano> >out.  It's pretty obvious from looking at the code.)
Giuliano> >

Giuliano> It might be obvious, but then can you tell me why I haven't got any
Giuliano> problems here?

How am I supposed to know?  Why are you being so abrasive?  I'm trying
to help you guys here.

Giuliano> One thing I forgot to say is that I haven't got any Port =
Giuliano> 5432 parameter line.

It's got nothing to do with the "Port" line.  This happens on *every*
key.

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Re: .ini parsing

From
sperber@informatik.uni-tuebingen.de (Michael Sperber [Mr. Preprocessor])
Date:
>>>>> "Giuliano" == Giuliano Gavazzi <dev@humph.com> writes:

Giuliano> At 16:35 +0100 2003/03/19, sperber@informatik.uni-tuebingen.de
Giuliano> (Michael Sperber [Mr.
Giuliano>   Pre wrote:
Giuliano> >Psqlodbc 7.2.5 isn't able to parse the .ini files produced by common
Giuliano> >.ini files creation programs, such as that shipped with iODBC.  The
Giuliano> >reason is that it cannot deal with spaces before the "=" signs.  So,
Giuliano> >
Giuliano> >Port= 5432
Giuliano> >
Giuliano> >is OK, but
Giuliano> >
Giuliano> >Port = 5432
Giuliano> >
Giuliano> >is not.  I think it would save a lot of confusion if this were fixed
Giuliano> >or at least a FAQ would talk about it.

Giuliano> strange. I use iODBC and it is fine with the spaces. Besides, are you
Giuliano> sure the odbc.ini is read by the driver and not by the iodbc driver
Giuliano> manager? You see, with the old version of iODBC on MacOSX the .ini
Giuliano> files were actually named differently and had a different location,
Giuliano> either the driver manager was passing the file location to the driver,
Giuliano> or, as I said above, the files were read by the iODBC driver manager
Giuliano> indeed.
Giuliano> Maybe this is a bug with the version of iODBC you are using.

No; iODBC parses the .ini file just fine, with spaces.  It's the
psqlodbc driver that doesn't.  (I'll be glad to provide details, but
I've actually debugged and read the code in question to figure this
out.  It's pretty obvious from looking at the code.)

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

Re: .ini parsing

From
"Hiroshi Inoue"
Date:
> -----Original Message-----
> From: Michael Sperber [Mr. Preprocessor]
>

[snip]

> Giuliano> Maybe this is a bug with the version of iODBC you are using.
>
> No; iODBC parses the .ini file just fine, with spaces.  It's the
> psqlodbc driver that doesn't.  (I'll be glad to provide details, but
> I've actually debugged and read the code in question to figure this
> out.  It's pretty obvious from looking at the code.)

Please build the driver --with-iodbc option if you use the driver
with iodbc. GetPrivateProfileString() in gpps.c isn't used with
the option.

regards,
Hiroshi Inoue