Page 1 of 1 1
Topic Options
#170435 - 2006-11-17 10:07 PM INI file size limit?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Is there a limit on INI file size?

I generated (and can read) an INI file that is 1.1 MB. Have no problem reading it, but when I try to enumerate the sections, I get an "expression too long!" error.

The code is:
Code:
 
$List = ReadProfileString('.\data.ini', '', '')



I'm thinking I may need to split this INI file into smaller parts.

Thanks

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#170436 - 2006-11-17 10:16 PM Re: INI file size limit?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
not sure but my guess is that the limit you hit there is the old string limit.
once the section names put together added with chr(10) for each becomes larger than 32000 chars, kixtart fails to enum the ini.

most likely it's a limitation of the API and not kix itself though.

Top
#170437 - 2006-11-17 10:52 PM Re: INI file size limit?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
ISTR that Wintendos ran into a size limit on INI files and it was pretty small, like 64k or so.
Top
#170438 - 2006-11-18 01:39 AM Re: INI file size limit?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
I worked around it - I'm able to read/write the entire file, just can't enumerate it. I think Joel hit the nail on this one. The file had 6600 hostnames in it, so certainly larger than 32K

Thanks,

Glenn

Top
#170439 - 2006-11-18 04:25 PM Re: INI file size limit?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
There might also be a section number limit in addition to file size limit.
_________________________
There are two types of vessels, submarines and targets.

Top
#170440 - 2006-11-18 09:48 PM Re: INI file size limit?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
but there shouldn't be no file size limit.
Top
#170441 - 2006-11-18 10:14 PM Re: INI file size limit?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The Windows API is supposed to have a 64k limit. Though I don't think that applies to Windows 2000+ anymore.
_________________________
There are two types of vessels, submarines and targets.

Top
#170442 - 2006-11-19 07:21 PM Re: INI file size limit?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
OK - specifically:
I can read it with Open/Readline;
I can read/write it with ReadProfileString / WriteProfileString;

I CAN NOT do:
Code:

$String = ReadProfileString('BigFile.ini', '', '')


to enumerate all of the headers in the ini file. There are 6600 headers, each about 10-15 characters. If you average them at 13 chars, plus the newline, that's 96K string size. Since I can read/write the file in Kix using different methods, there's no issue with file size - either the enumeration in kix failed, or - more likely - the string size limit has been exceeded.

Glenn

Top
#170443 - 2006-11-20 04:33 AM Re: INI file size limit?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Don't forget that KiXtart uses the Windows API, thus it might be a problem with the API and not KiXtart itself.
_________________________
There are two types of vessels, submarines and targets.

Top
#170444 - 2006-11-21 06:00 PM Re: INI file size limit?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Glenn,

You bring up an interesting point.. That is, from the days of Windows 3.x, the system was able to use the WIN.INI and SYSTEM.INI, but M$ quickly ran into a problem with a 64k ceiling for "reading" INI files. That is why they went to the Registry.. However, the 64k ceiling does not seem to be an issue with KiX as it can "read" files much greater than 64k in size.

Anyway, some thoughts to ponder.

Kent

Top
#170445 - 2006-11-21 06:19 PM Re: INI file size limit?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
Yeah - I use INI files all the time to organize large amounts of data, especially where there may be dups of keys. I can read the "count" value for an element, and append it to further elements, incrementing the count every time I write an entry. This way I can identify multiple records. It's kinda like a Hash, but on disk, so I can refer to it later.

Never seem to have an issue with file size.

Glenn

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.061 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org