Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-08

Units for reading of config files?

12 messages · 9 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort
to Peter Vreman
>Are there any ready-to-use units for the parsing of config-files? (for >the linux-version) In the FCL is a unit inifiles

My conffiles unit is on the contributed pages site. That one can also do "nested" ini, and other stuff (like Golded'ish configuration files)

Aitor Santamaria Merino
to Marco van de Voort
Marco van de Voort wrote 8 lines
> >Are there any ready-to-use units for the parsing of config-files? (for > >the linux-version) > > In the FCL is a unit inifiles My conffiles unit is on the contributed pages site. That one can also do "nested" ini, and other stuff (like Golded'ish configuration files)

Ok, ok, I might be saying something stupid, but I have just looked at your source and found this. Looks like a small bug, but...

function IsFile(const S: String): Boolean;
var
  SR: SearchRec;
begin
  FindFirst(S, Anyfile-directory, SR);

^^^^^ Ok, so you look for any file with no-directory attribute

  if DosError = 0 then
    IsFile := SR.Attr and Directory  0

^^^^^ This returns TRUE whenever it is a directory?

  else IsFile := False;
end;

Aitor

Marco van de Voort
to Aitor Santamaria Merino

[ Charset ISO-8859-1 unsupported, converting... ]

Show quoted text 14 lines
Marco van de Voort escribi?: > > > >Are there any ready-to-use units for the parsing of config-files? (for > > >the linux-version) > > > > In the FCL is a unit inifiles > > My conffiles unit is on the contributed pages site. That one can also do > "nested" ini, and other stuff (like Golded'ish configuration files) Ok, ok, I might be saying something stupid, but I have just looked at your source and found this. Looks like a small bug, but...

Looks not good yes. Don't know if it is a stupid bug, or an ancient workaround for the first win32 versions.

Will check it tomorrow.

Pierre Muller
to Marco van de Voort
you wrote 20 lines
[ Charset ISO-8859-1 unsupported, converting... ] > > > Marco van de Voort escribi?: > > > > > >Are there any ready-to-use units for the parsing of config-files? (for > > > >the linux-version) > > > > > > In the FCL is a unit inifiles > > > > My conffiles unit is on the contributed pages site. That one can also do > > "nested" ini, and other stuff (like Golded'ish configuration files) > > Ok, ok, I might be saying something stupid, but I have just looked at > your source and found this. Looks like a small bug, but... Looks not good yes. Don't know if it is a stupid bug, or an ancient workaround for the first win32 versions. Will check it tomorrow.

No, I think that this is related to a bug in certain Dos version where you get directories, even if you don't ask for them...

Ralf A. Quint
to Aitor Santamaria Merino: Ok, ok, I might be saying something stupid, but I have just looked at your source and…
you wrote 26 lines
Marco van de Voort escribió: > > > >Are there any ready-to-use units for the parsing of config-files? (for > > >the linux-version) > > > > In the FCL is a unit inifiles > > My conffiles unit is on the contributed pages site. That one can also do > "nested" ini, and other stuff (like Golded'ish configuration files) Ok, ok, I might be saying something stupid, but I have just looked at your source and found this. Looks like a small bug, but... function IsFile(const S: String): Boolean; var SR: SearchRec; begin FindFirst(S, Anyfile-directory, SR); ^^^^^ Ok, so you look for any file with no-directory attribute if DosError = 0 then IsFile := SR.Attr and Directory 0 ^^^^^ This returns TRUE whenever it is a directory?

The problem is that (anyfile-directory) include the attribute for "volume label". It's a "feature" of DOS that in this case the call also returns directories...

Ralf

Peter Vreman
How can i find some help how to install shared library for RTL and other libraries ? I am using FPC 1.0.4 on Debian 2.2 Potato.

When you have the source of the rtl you can type 'make shared'. But there were problems with the shared libraries. And there is no PIC code generated. Until everything is sorted it is not recommended to use shared libraries for production. It's currently in an experimental state.

Unknown author
to Fernando Lozano
Fernando Lozano wrote
Hi there, Anyone know where to find examples on how to use ODBC and/or ADO from a Free Pascal program?

ODBC should be possible to do if you have the headers for C programs; For ADO the matter is not so simple since it uses COM, and I haven't seen any FPC programs yet that use COM.

(If there are people that have COM programs, please send me some code so I can add a section to the manual on how to do it)

Michael.