If, for example, you want to back up a certain directory to different data carriers or different directories to a USB hard disk, it is advisable to use different profiles. For each of these cases, a special backup profile is necessary, which you can save in a configuration file. E-mail or FTP programmes also frequently use different accounts or profiles. It is often necessary to create or change new profiles or to delete unused profiles.
One solution could be
Do not try to edit a configuration file with a Settings object and with a serial stream (Open, …) at the same time. Yes, it is possible because Linux allows several processes to open a file at the same time, but it jeopardises the integrity of your data. This is because you can never know the order in which the read/write accesses are executed, because all these accesses are buffered.
' Man sollte nicht in Dateien stöbern und Inhalte ändern, die bereits von einem Objekt genutzt werden. hFile = OPEN (Application.Path &/ "Profil/ftp.conf") FOR INPUT ' Profilnamen auslesen WHILE NOT Eof(hFile) LINE INPUT #hFile, sLine IF Mid(sLine, 1, 3) = "[P_" THEN aProfilMatrix.Add(Mid(sLine, 2, String.Len(sLine) - 2)) cmbFTPProfilName.Add(Mid(sLine, 4, String.Len(sLine) - 4)) ENDIF WEND CLOSE #hFile