<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Em sáb., 2 de ago. de 2025 às 11:19, Rafael Picanço via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Flavio, thanks for that! </div><div><br></div><div>However, TMemIniFile.Rename cleans up its content with FStream := nil (Am I correct?). So, In my case I would need to adapt it further so that:</div><div><br></div>procedure ArchiveIniFileTo(AMemIniFile: TMemIniFile; ADestination : string);<div>var</div><div> TemporaryDestination : string;</div><div>begin</div><div> TemporaryDestination :=
AMemIniFile.Filename;</div><div>
AMemIniFile.RenameAndNothingElse(ADestination);</div><div>
AMemIniFile.UpdateFile; // Flush data to disc<br> AMemIniFile.RenameAndNothingElse(TemporaryDestination);</div><div>end;</div><div><br></div><div>Best,</div><div>Rafael Picanço</div></div></blockquote><div> </div><div>No, Rename() doesn't cleanup the contents. FStream is only stored (if you load/initialize the TIniFile/TMemIniFile from a stream) so that UpdateFile() can update/overwrite that stream with the new ini values.</div><div>When loading from a stream, TIniFile/TMemIniFile read all values inside its constructor, just like when loading from a file. </div><div> </div><div>-Flávio</div></div></div>