Em sáb., 2 de ago. de 2025 às 11:19, Rafael Picanço via fpc-pascal < fpc-pascal@lists.freepascal.org> escreveu:
> Flavio, thanks for that! > > 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: > > procedure ArchiveIniFileTo(AMemIniFile: TMemIniFile; ADestination : > string); > var > TemporaryDestination : string; > begin > TemporaryDestination := AMemIniFile.Filename; > AMemIniFile.RenameAndNothingElse(ADestination); > AMemIniFile.UpdateFile; // Flush data to disc > AMemIniFile.RenameAndNothingElse(TemporaryDestination); > end; > > Best, > Rafael Picanço > 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. When loading from a stream, TIniFile/TMemIniFile read all values inside its constructor, just like when loading from a file. -Flávio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal