[Lazarus] Lazarus created an lfm form file from the dfm but uses both causing confusion...

Bo Berglund bo.berglund at gmail.com
Sun May 9 21:26:00 CEST 2021


On Fri, 07 May 2021 02:14:36 +0200, Bo Berglund via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

UPDATE:
I managed to clear up the mess and found some interesting things in the
process...

>This week I have modified form layouts by moving stuff around and changing
>properties etc. For some reason Lazarus then created lfm form files where the
>new layout can be seen. In fact Lazarus uses the lfm files in the IDE...
>I did not notice that this had happened.

In fact this was NOT what had happened! The files were still dfm files up until
the "delete accident" happened! I just assumed this was what had happened.

>
>Today I had an accident that deleted the code folder completely except for some
>remaining files from which I have reconstructed the project using the last SVN
>commit and the weekly backup of my PC taken Saturday night too.

In addition to the SVN commit and the backup done earlier I also had this
"mysterious" client folder contaiining actual source files all with a file date
about the time of the accidental delete.
And here all form files had extension lfm.

Yesterday while driving I realized what must have happened is this:
- At the time of the accidental delete Lazarus was running and had a dozen or
more source files open in the code editor.
- When the source dir suddenly disappeared Lazarus noted this
- When I saw that Lazarus was running I thought this was not a good idea so I
tried shutting it down
- This caused Lazarus to pop up a lot of error messages, which I clicked away
until done.
- The error messages were popped up because Lazarus apparently had lost
connection to the files on disk and it tried to solve the situation.

The end result of this was that Lazarus *saved* the contrent of all the sources
it had open to the path they were read from, recreating the missing folders in
the process!
And since there were no dfm files to overwrite it saved the forms in native
Lazarus format as lfm files.

So the folder I found is actually *all* of the sources in the editor as they
were when the crash happened!

When I then could reach my computer I tested by:
1) Renaming all lfm files to dfm extension in the "save" directory
2) Copying the content of this directory to the newly checked out project
overwriting all existing files
3) Now started Lazarus.

At this point the project auto-loaded again and when I ran a build it succeeded
and the binary looked exactly like it did before all this happened! :)

So I was saved by Lazarus! It would not let the loaded files disappear!


-- 
Bo Berglund
Developer in Sweden



More information about the lazarus mailing list