Demon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > XWE > Backups have "dead" lumps
 
Author
All times are GMT. The time now is 12:59. Post New Thread    Post A Reply
myk
volveré y seré millones


Posts: 15226
Registered: 04-02


I set XWE to do the minimum possible restoration, I use only one backup and have disabled undo. Generally, I don't need to undo or restore anything, but I accidentally saved a file with the same name when I was trying to create a subset with only part of the resources, so now I have the offshoot file and a backup of the original.

I renamed the backup, which is the size of the old file, but it still displays only the lumps I didn't delete (either in any wad editing tool or in the game). The data of the deleted lumps is still in there in some form (I even see a text format lump in a text editing program), but it isn't recognized. Is there any way to restore those lumps?

Old Post 07-11-07 17:47 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
hawkwind
Senior Member


Posts: 1015
Registered: 04-04


To help Csabo and others, is this for 1.16 or the latest beta ?

Old Post 07-12-07 03:38 #
hawkwind is offline Profile || Blog || PM || Search || Add Buddy IP || Edit || Quote
myk
volveré y seré millones


Posts: 15226
Registered: 04-02


Well, thanks for that, because you reminded me to update to the latest.

It was an older beta from November 23rd, but I just tried it with the newer one (July 11th), and it did the same thing on a test wad. It's easy to reproduce; just grap a wad with a bunch of lumps, delete some, rename the BAK file to WAD, and open it. It lists the undeleted lumps only, but has the size of the original file.

Old Post 07-12-07 03:52 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


I'm sorry you ran into this problem. It may sound weird, but this behavior is by design.

Here's what happens: You open a WAD and delete some lumps. There is no BAK file at this point! It's a final change written straight to the WAD. Give it a try and check it - no BAK file. (Note: there is an undo file however, in the temp folder, so at this point, your delete is easily undoable.)

When you close XWE, there's an option which is turned on by default called "Perform Clean Up on exit". The Clean Up function rewrites whole WAD file to reclaim wasted space. Wasted space is produced for a lot of operations, this is normal for most WAD editing programs (it's not feasible to keep rewriting the whole WAD all the time - especially for very large files). Before clean up occurs, a BAK is created. But that BAK - as you pointed out - already has your files deleted (again, as you pointed out - deleted from the lump list, but not from the actual file). Then the new cleaned up file is written.

Technically it's possible to recreate those lumps, but it's manual work, hacking around with HEX editors. If I recall correctly, DeepSea had some tools for this, you could look into that if getting the lost data is vital.

Old Post 07-15-07 03:57 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


I added a new option which is turned on by default: "Automatically create a backup file when a WAD file is opened". It basically performs a "clean-up" when you open a WAD (which leaves the original file as a backup).

Pro: with this option enabled, I'm confident that there will be no data loss of any kind using XWE.

Cons: 1) it will create more files, which take up disk space (those can be deleted). 2) If you open very large files, this may take a while (so you can consider turning this off).

Old Post 07-29-07 18:52 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
myk
volveré y seré millones


Posts: 15226
Registered: 04-02


It's annoying how it messes even with the IWADs (most people open these a lot). Setting the Read only attribute will get rid of the problem for individual files you don't want modified, but it's still not very convenient because it'll modify (at least the date stamp) any wad opened.

XWE adds an option to the right click menu that says "Edit with XWE". Perhaps this could be changed to two options, one that says View with XWE and another that says Edit with XWE? View making no backup but allowing you to browse the wad or save lumps and resources to disk. Maybe you could add suboptions so that it doesn't clutter the right click menu:

code:
XWE --> View with XWE Edit with XWE Edit with XWE (no backup)
Not sure which should be the default for double clicking, maybe that could be set in the INI file. Also, if there were an internal "toggle editing/viewing mode" in the XWE menus one could change once the program is running, and it would make any necessary backup once the editing mode is enabled.

But backing up would be much simpler if the program temporarily cached all the changes to disk and applied them to the wad only when exiting, creating the backup right before making all the changes, or when the user selects "save wad".

Old Post 07-29-07 19:35 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
Csabo
Moderator


Posts: 541
Registered: 02-02


I see your point. This change is probably a necessary one, I think if I can nail it, XWE will be a much more solid app.

I think what it should do is, when a WAD is opened, copy it to a temp file (e.g. add ".XWE" to the filename), and work on that. If Save is selected, the original is renamed to a backup name and the temp file is renamed to the original name. I'll have to think about it a bit more, and I'll try to add this soon.

Old Post 08-03-07 04:33 #
Csabo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit || Quote
All times are GMT. The time now is 12:59. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Special Interest > XWE > Backups have "dead" lumps

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.