ERROR:Unexpected end-of-file (position=154180758, recordnumber=54457, cell=5)


How can I fix the error in this file?
While using KLayout, after completing my layout, I clicked save and immediately closed the KLayout software. This interrupted the saving process, resulting in a corrupted file.

Comments

  • Some queries:

    1. Version 0.25.3 is over six years old. Is there any reason not to update to the latest version?

    2. Which binary distribution did you install, and on which OS?

    3. In what format did you save your layout design? GDS2, OASIS, or some other format.

    4. Are you getting the error while saving the file, not when reading back the saved file? Please confirm.

  • edited August 5

    Hi @lmz,

    I'm afraid this file is broken an cannot be repaired.

    But don't close the program while saving is in progress. Later versions of the tool will write the file to a temporary file first and only replace the original file with the new version once the save is done. Corrupt files should not happen with later versions.

    Still it is possible to kill the process during save. Just don't do that if you do not want to lose your work.

    Matthias

  • Hi @Matthias
    Your meaning is that my version is too old, and if I upgrade to the new version, I can avoid file corruption caused by closing the file during the save process, right? But I need to use Python to complete my layout design, and it seems like my Python version is also too low. If I update, do I need to update everything?

  • Hi @sekigawa
    Thank you for your inquiry, but this file is probably beyond repair, I am using a Windows system to design GDS2 layouts, and I encountered an error when exiting. The reason I'm using this older version of KLayout is that I need it for my layout design, and I also use Python scripts to help me complete the task. I'm not sure if I need to update everything because I'm not very familiar with Python and KLayout. I've only been working with them for a little over a month, so I'm a bit worried about making mistakes, which could waste a lot of my time. Could you tell me what benefits the new version offers? I might consider updating in the future if I get the chance.

  • Hi @lmz,

    Thanks for your reply.
    A newer version is not always better than an old version. See this related discussion.
    Sometimes, new bugs are introduced in a new version.
    If an older version is stable enough to carry out daily routines, I think using the latest one is unnecessary.
    In fact, 0.26.x is still used in my company.
    However, IMHO, a new version is generally preferable since:
    1. there are some enhancements and improvements, as described in the Release Notes
    2. it will be easier for the maintainer to remember what was made in relatively new versions

    We also need to be aware of the dependency issues. For example, 0.25.9 (closest to your version) ZIP binary for Windows bundles Python 3.5.2, which is no longer supported.
    If some Python modules require a newer version of Python 3, you may also need a newer KLayout.

    Kazzz-S

  • Long time agoa I lost a file with the same error, since then, I always have a backup with that option.
    Still with an older version you can use the backup option in the setup menu :
    [File] - [Setup] then Application - General : Number of backup file : at least 1

    Laurent

  • Hi @laurent_c,

    thanks for pointing to this option :)

    In the latest release (0.29.6) I have included a warning that pops up when you try to close the main window while a save operation is ongoing. I hope this prevents the above problem in the first place.

    Matthias

Sign In or Register to comment.