Hi Fpc-Pascal Users,
P.S. Although these classes are meant for compatibility with
Delphi/Windows,
that's not even entirely compatible. Afair Windows could partially
overwrite lines in the file instead of the whole file at once
maybe they should provide extra methods with correct excepti
Em sex., 1 de ago. de 2025, 17:54, James Richters via fpc-pascal <
fpc-pascal@lists.freepascal.org> escreveu:
> Thank you for the great suggestions! I did not know I could have a
> memory version of the ini file.
> that sounds like a better solution than what I am doing. Right now I am
> reading
>> then I use those as needed.. then write them all out, but if I am
understanding it correctly could I just use the memory version of the ini
file directly?
In my case, I have a protocol where some parameters must be archived and
IniFiles are handy when I need to do some eye inspection on them.
C
Thank you for the great suggestions! I did not know I could have a memory
version of the ini file.
that sounds like a better solution than what I am doing. Right now I am
reading in all the ini settings and putting them into variables like
Ini_myvariable
then I use those as needed.. then wri
al Wiki (Tim Coates)
>
>
> --
>
> Message: 1
> Date: Wed, 30 Jul 2025 16:25:51 +0200 (CEST)
> From: Michael Van Canneyt
> To: FPC-Pascal users discussions
> Subject: Re: [fpc-pascal] TIniFile crash
>
On Tue, 29 Jul 2025, James Richters via fpc-pascal wrote:
I will try just creating a temp file, and once it’s completed delete the
original file then rename the temp file to the correct name, it’s a good idea,
and a least I will now that nothing I am doing is trying to access the file…
beca
y 29, 2025 2:26 PM
To: fpc-pascal@lists.freepascal.org
Cc: Ralf Quint
Subject: Re: [fpc-pascal] TIniFile crash
On 7/26/2025 2:05 PM, James Richters via fpc-pascal wrote:
I’m having an issue with TIniFile,
I have a pretty simple procedure, It deletes the old .ini file, waits for it
to be gone,
On 7/26/2025 2:05 PM, James Richters via fpc-pascal wrote:
I’m having an issue with TIniFile,
I have a pretty simple procedure,It deletes the old .ini file, waits
for it to be gone, creates a new one, writes a bunch of variables to
it, then frees it.It works 99% of the time, but 1% of the time
May be it would be safer to read the list of sections with INI.ReadSections
and then delete each section with INI.EraseSection ?
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
I'm having an issue with TIniFile,
I have a pretty simple procedure, It deletes the old .ini file, waits for
it to be gone, creates a new one, writes a bunch of variables to it, then
frees it. It works 99% of the time, but 1% of the time it crashes right in
the middle of writing the file. The
On 4/1/11, DaWorm wrote:
> On Fri, Apr 1, 2011 at 9:09 AM, Bart wrote:
> It
> seems to me like a lot of effort to trap something that will rarely
> happen.
But it does happen.
I don't mind that it raises an exception in Destroy (although I find
it rather odd), but the consequences of raising t
Hello FPC-Pascal,
Friday, April 1, 2011, 2:45:38 PM, you wrote:
D> On Fri, Apr 1, 2011 at 6:28 AM, José Mejuto wrote:
>> An exception in free is an extreme rare condition, but it could
>> happend, and is better that your software stops to work than notify 2
>> years later that your 2 zillions of
On Fri, Apr 1, 2011 at 9:09 AM, Bart wrote:
>> The test case was an invalid filename. Is this the primary failure
>> method?
>
> This was merely to demonstrate the possibility of the destructor failing.
What other things would make the destructor of the TIniFile fail? It
seems to me like a lot
On 4/1/11, DaWorm wrote:
> The test case was an invalid filename. Is this the primary failure
> method?
This was merely to demonstrate the possibility of the destructor failing.
Bart
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://l
On Fri, Apr 1, 2011 at 6:28 AM, José Mejuto wrote:
> An exception in free is an extreme rare condition, but it could
> happend, and is better that your software stops to work than notify 2
> years later that your 2 zillions of INI files were not written at all
> because the user write a non valid
Hello FPC-Pascal,
Friday, April 1, 2011, 9:58:24 AM, you wrote:
MVC> 2. Cache the updates, and make sure they are written when the instance is
destroyed.
MVC> This is the current behaviour. It works fast, but the corner case you
encountered
MVC> (an error when updating the file in the d
In our previous episode, Michael Van Canneyt said:
> Going back to 1 is not an option.
> For case 2, I am inclined to say that the destructor must always succeed.
> Errors in destructors are very ugly to trap.
... time to mark tinifile as deprecated ?
_
On Fri, 1 Apr 2011, Bart wrote:
On 3/31/11, José Mejuto wrote:
B> This however means that the programmer has to protect TIniFile.Free
B> with a Try..Except block, which is also rather unusual.
It's unusual, but there is an error, or the class does not perform the
save in the free procedure
Hello FPC-Pascal,
Friday, April 1, 2011, 12:17:30 AM, you wrote:
B> The job of the destructor, however, is to clean up the object and return
memory.
B> This should never fail IMHO.
The clean up has not been successfully performed as in this class a
file update is part of the clean up. There are
On 3/31/11, José Mejuto wrote:
> B> This however means that the programmer has to protect TIniFile.Free
> B> with a Try..Except block, which is also rather unusual.
>
> It's unusual, but there is an error, or the class does not perform the
> save in the free procedure and uses a "flush" (forced) o
Hello FPC-Pascal,
Thursday, March 31, 2011, 6:52:26 PM, you wrote:
B> This however means that the programmer has to protect TIniFile.Free
B> with a Try..Except block, which is also rather unusual.
It's unusual, but there is an error, or the class does not perform the
save in the free procedure a
This however means that the programmer has to protect TIniFile.Free
with a Try..Except block, which is also rather unusual.
Bart
On 3/31/11, José Mejuto wrote:
> Hello FPC-Pascal,
>
> Thursday, March 31, 2011, 5:05:35 PM, you wrote:
>
>>> Should I report this behaviour as a bug, or is it conside
Hello FPC-Pascal,
Thursday, March 31, 2011, 5:05:35 PM, you wrote:
>> Should I report this behaviour as a bug, or is it considered "by design"?
>> (My old Delphi does not support the CacheUpdates property, so I cannot
>> test how it behaves in Delphi)
mvwb> Please report it as a bug. Your fix pro
On Thu, 31 Mar 2011, Bart wrote:
When you use TIniFile with CacheUpdates := true, then when you free
the TIniFile an error can occur if the component was unable to update
the changes (in UpdateFile), this will then raise an exception, which
in turn will lead to not calling inherited Destroy, t
When you use TIniFile with CacheUpdates := true, then when you free
the TIniFile an error can occur if the component was unable to update
the changes (in UpdateFile), this will then raise an exception, which
in turn will lead to not calling inherited Destroy, thus leading to
memory loss, which cann
25 matches
Mail list logo