🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265534

Re: DIALOG settings.ini identity syntax section locations

#265534
From: wasbit
Date: Sat, 30 Apr 2022 10:22
161 lines
8404 bytes
"Bernd Rose" <b.rose.tmpbox@arcor.de>" wrote in message
news:11kgreixfjb9q$.dlg@b.rose.tmpbox.news.arcor.de...

> If I understand correctly, you recreate everything from scratch? (Instead
> of restoring a current backup.) 

Not really. I make a full backup periodically because corruptions are
frequent enough and you never know what got corrupted.

But I only pull out of that full backup the few files that are required for
customizations to be recreated (such as a dictionary file).

But if there's a better method to recover from corruptions, I'll learn it.

> I'd rather suggest to keep a full backup of the Dialog folder and its 
> subfolders (with the exception of "data") and replace it, whenever a 
> substantial change in settings (like a new or altered identity) occurred. 

That might be easier than what I'm doing now but data contains most of the
changes over time and settings.ini can get corrupted (which was my most
recent corruption).

> The backup must only be created, when Dialog is not running, of course.

Of course.
 
> For the data folder, keep the backups (at least the latest) after running
> CompactDatabase.

I don't really know how compacting affects being able to copy back at a
later date.

Therefore I'm afraid to compact because I don't know if that makes it
compatible or not but the real problem with copying back the entire data
directory is I don't know which files got corrupted and they may be one of
those data files that I don't need to copy over. So I let a new dialog
installation re-create those data files which I didn't customize.

How does compacting help in terms of copying back files later?

> Alternatively, you can do a full backup by copying it
> at any time. (Again: Dialog not running, of course.) *Never* mix two
> different states of the data folder!! You'd break the database this way,
> for sure.

That's why I'm afraid to compact because I don't know what 'state' that
leaves things in. I only work with NOT compacted files in Dialog.

If compacting helps, I don't understand how (other than to make files
smaller but that's not the issue here).

> After setup and/or database corruption, you'd get back to the latest 
> saved state quite easily. (Without any manual pre-configuration steps,
> like setting up dummy-identities inside the GUI.

But what if the settings.ini file is what got corrupted?

>> As the last step of repopulating Dialog if I create an equal number of
>> dummy identities inside the Dialog GUI
> 
> This step should have also created the correct setting of IdentitiesCount 
> inside the [General] section.

I realized my mistake in concluding wrongly that the POSITION of the
identities mattered. It wasn't the position after all. It was that I was
unaware of the GENERAL section in settings.ini which required a manual
setting of the number of identities. That was all my fault. 

I no longer think identity position was the problem, thanks to you!

The only reason the dummy creation worked was because that process ALSO
added the right counter to the GENERAL section. 

Over the years I had come up with a workaround solution that works, but for
the wrong reasons. :()

>> then I close Dialog and swap out the separate text files [BR: containing
>> the backed up identity settings] into the settings.ini file with each 
>> identity in the exact strange places that they end up in the
>> settings.ini files, then it always works.
> 
> Please note, that reference of an identity (to its folder and so on) in
> the database is /not/ the number in the section name. (Like e.g. "3" for 
> [Identity3]. The number just defines the sort order of the identities
> inside the Dialog GUI. - Although the numbers ought to be continuous
> (starting by 0), overall, and must not be larger than IdentitiesCount
> minus 1.

No problem. If the identity is "tom" "dick" and "harry", then the identity
section will be named "Identity0", "Identity1" and "Identity2."

Below that line will be the assignment to "tom" "dick" and "harry."
 
> The pointer to the database folders is the "name" of the identity. If you
> pre-create the dummy-identities inside the GUI you /need/ to make their
> names identical to the ones restored from your backup text files to the
> last single character. Else, the connection of the identity to the 
> Dialog database is broken and your next crash is bound to happen soon.

I don't understand anything in that paragraph because I don't see any
folders that have anything to do with any identity (or even the number of
identities). 

With or without any number of identities, I don't see any difference in the
name or number of folders inside the dialog directory.

But maybe we can just ignore that paragraph because I'm not having problems
with adding back identities with my workaround, and I don't expect to have
problems when I next add them back since I now know to change the number of
identities in the General section.

>> but my question here is what is the logic of where identities go inside 
>> the settings.ini file?
> 
> IMHO, the section order largely depends on creation/alteration time and
> therefore is (more-the-less) driven by chance. AFAICT, the placement of
> each section is left to the Windows *.ini-file management functions. 

Yes. I am aware of this now. I was wrong before. I didn't know about
setting the number of identities in the General section until you said it.

> If a section does not exist, it is inserted top-most by these functions.

I think the order is actually more random than even that since I can do
nothing but insert identities and they end up in a different order than I
inserted them the moment I start Dialog but I think in the end that this
doesn't matter anymore now that I know about changing the number of
identities in the General section (thanks to you).

> If just a value inside an existing section is altered, the placement of
> the section remains unaltered. Dialog seems(!) to write some settings
> by replacing sections in whole. (= Deleting them and writing them anew.)

Good to know.

> Depending on you altering here and there in the GUI, each of /these/
> sections have a chance to end up top-most at any given moment. Altering
> existing identities, OTOH, has no such section-reordering effect. The
> latest (by creation date and time) identity will be topmost of all
> identities. But there may be (one or more) arbitrary other sections
> between each pair of identities, because of the process described above.
> 
> Nevertheless, the placement of a certain section inside settings.ini
> shouldn't matter the least to Dialog.

I know that now! Thanks to you.

What I will look at more closely is if your method of replacing the files
is better than mine which currently consists of replacing ONLY those files
that I KNOW I have customized.

Sometimes I'm sure of which files it is that I've customized, like the cto
files which have the name of the category or the group files which have the
name of the server. 

Other times I'm not sure which files I've customized, like in the
dictionary folder where I bring over them all but probably I don't need to
bring all over (just my additions).
-- 
Regards
wasbit
Technical Details
Message-ID: <t4j2lf$1kg$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <t4enug$5vf$1@dont-email.me> <jj9ur27pmzkh.dlg@b.rose.tmpbox.news.arcor.de> <t4hrjd$7ri$1@dont-email.me> <11kgreixfjb9q$.dlg@b.rose.tmpbox.news.arcor.de>

Show Full Headers
Complete Article Headers
Message-ID: <t4j2lf$1kg$1@dont-email.me>
Subject: Re: DIALOG settings.ini identity syntax section locations
Date: Sat, 30 Apr 2022 12:22:57 +0200
From: wasbit <wasbitREMOVE@hotmail.com>
References: <t4enug$5vf$1@dont-email.me> <jj9ur27pmzkh.dlg@b.rose.tmpbox.news.arcor.de> <t4hrjd$7ri$1@dont-email.me> <11kgreixfjb9q$.dlg@b.rose.tmpbox.news.arcor.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.readers
Organization: A noiseless patient Spider
Lines: 161
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Apr 2022 10:22:39 -0000 (UTC)
Cancel-Lock: sha1:ggfWyRDngsM2ZebjJrRz/hc5ctE=
X-Mimeole: Produced By Microsoft MimeOLE V14.0.8089.726
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
Importance: Normal
X-Msmail-Priority: Normal