* * *

Author Topic: Corrupted project file  (Read 2347 times)

Ronan

  • Full Member
  • ***
  • Posts: 130
Corrupted project file
« on: January 12, 2018, 02:57:55 pm »
Dear all,

I have a main unit file in my aplication and it never accepts changes made at the design time, spawns an error such as "stream read erro" I really don't know how I have done it, trying to create every little button and other things in run time is very annoying, how can I remedy the situation?

REgards,

Bart

  • Hero Member
  • *****
  • Posts: 3115
    • Bart en Mariska's Webstek
Re: Corrupted project file
« Reply #1 on: January 12, 2018, 03:32:41 pm »
Do you see anything strange in the lfm file if you open it in a texteditor?

Bart

Ronan

  • Full Member
  • ***
  • Posts: 130
Re: Corrupted project file
« Reply #2 on: January 12, 2018, 03:37:11 pm »
Absolutely not, sometimes this where I try to modify it otherwise it never accepts anything at all,
what specificially should I look for ?

Handoko

  • Hero Member
  • *****
  • Posts: 2610
  • My goal: build my own game engine using Lazarus
Re: Corrupted project file
« Reply #3 on: January 12, 2018, 03:52:00 pm »
Lots of possibilities, hardware, virus, antivirus or it could be bug in the Lazarus.

Maybe you can install other version of Lazarus and try it still happens or not. Or try to copy the project and develop it on other pc. Or maybe copy/move the project to other directory or drive. You should make sure your computer is virus free and run a full scandisk.

Does it happens on a certain project only? If yes, maybe you can share it here for others to test.

And don't forget to backup.

howardpc

  • Hero Member
  • *****
  • Posts: 2780
Re: Corrupted project file
« Reply #4 on: January 12, 2018, 03:57:37 pm »
A good way to copy your project is via Project->Publish project...
Test if the problem happens when you open the published project (not the original).
If so, zip the published project and post here.

jamie

  • Hero Member
  • *****
  • Posts: 835
Re: Corrupted project file
« Reply #5 on: January 12, 2018, 11:40:40 pm »
or it could have been left open in another session of Laz and has Read only attached to it?

bylaardt

  • Sr. Member
  • ****
  • Posts: 269
Re: Corrupted project file
« Reply #6 on: January 13, 2018, 01:06:25 am »
Do you see anything strange in the lfm file if you open it in a texteditor?
is your .lfm file saved on UTF8 format?

Ronan

  • Full Member
  • ***
  • Posts: 130
Re: Corrupted project file
« Reply #7 on: January 13, 2018, 09:30:39 am »
Quote
or it could have been left open in another session of Laz and has Read only attached to it
How am I supposed to testify, interestingly it is exact that file which I have duplicated and used in another project. So its its a duplicate of another file in the project but with different name probably it has affected itself somehow, from that point onward I reallly don't know how to remedy it, I 'll appreciate your guidance.

Quote
is your .lfm file saved on UTF8 format?
I googgled for a while but didn't retrieve the result related to the file format obtaining. Even if its saved in UTF-8 format what am I supposed to do to convert it to original format?

Regards,

howardpc

  • Hero Member
  • *****
  • Posts: 2780
Re: Corrupted project file
« Reply #8 on: January 13, 2018, 11:21:21 am »
The brute force approach should work.
Start a new Lazarus project.
Build your new main form (and any subsidiary forms) from scratch in the usual way.
Non-form units (those not requiring .lfm resources) can be copied into your project with no penalty.
Build (or Run) your new project periodically as you reconstruct it to check that all is OK.

As you work you will also discover several ways to improve what you had before...

valdir.marcos

  • Hero Member
  • *****
  • Posts: 516
Re: Corrupted project file
« Reply #9 on: January 13, 2018, 03:45:28 pm »
Quote
is your .lfm file saved on UTF8 format?
I googgled for a while but didn't retrieve the result related to the file format obtaining. Even if its saved in UTF-8 format what am I supposed to do to convert it to original format?

There are many solutions, I have attached a solution for Microsoft Windows using Notepad++ as one example of converting a file format from ANSI to UTF8.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 516
Re: Corrupted project file
« Reply #10 on: January 13, 2018, 03:48:20 pm »
The brute force approach should work.
Start a new Lazarus project.
Build your new main form (and any subsidiary forms) from scratch in the usual way.
Non-form units (those not requiring .lfm resources) can be copied into your project with no penalty.
Build (or Run) your new project periodically as you reconstruct it to check that all is OK.

As you work you will also discover several ways to improve what you had before...

+1

valdir.marcos

  • Hero Member
  • *****
  • Posts: 516
Re: Corrupted project file
« Reply #11 on: January 13, 2018, 03:52:56 pm »
Quote
or it could have been left open in another session of Laz and has Read only attached to it
How am I supposed to testify, interestingly it is exact that file which I have duplicated and used in another project. So its its a duplicate of another file in the project but with different name probably it has affected itself somehow, from that point onward I reallly don't know how to remedy it, I 'll appreciate your guidance.

Use the brute force approach proposed by howardpc.
You need to rebuild your project unit by unit to discover where is the problem.
As you rebuild it, just as howardpc said, you will evolve it a lot.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus