User forums > Nightly builds

The 30 December 2018 build (11543) is out.

<< < (11/13) > >>

UberNewb2:

--- Quote from: oBFusCATed on January 11, 2019, 08:23:27 am ---
--- Quote from: UberNewb2 on January 11, 2019, 05:27:39 am ---..., but I lost a file in the process. It was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty....

--- End quote ---

For these cases we use backup solutions. In the software development world these are called version control systems. The one which won the battle is called git. Start using it, even for personal projects and you won't have problems like these in the future.

--- End quote ---

If you're going to chastise me, at least read what I said.

--- Quote from: UberNewb2 on January 11, 2019, 05:27:39 am ---And I probably had several hundred lines of code that were three days old since the last commit.

--- End quote ---


--- Quote from: BlueHazzard on January 11, 2019, 12:39:51 pm ---
--- Quote ---It was open in the Code Blocks editor, and after Windows recovered from the blue screen and restarted, the file was empty. I opened it with a hex editor and discovered it was a bunch of zeros. The entire file contents were wiped out.
--- End quote ---
Also codeblocks uses some special save procedure to prevent exactly this. It saves the file first in a temporary file, copies the temporary file over the old file and then removes the temp file after the copy process was successful. So there is always a valid file with your content on the system if something bad is happening

--- End quote ---
The file had already been saved I believe, as I was in the process of running the project right after building it.

Something happened during the crash that overwrote the file.

However, if you say CB creates temporary files, perhaps I could recover one of those. Are they stored in the same directory as the source file in question?


--- Quote from: oBFusCATed on January 11, 2019, 07:14:54 pm ---Doing the save-to-temp-and-move prevents problems only if cb crashes. If the os crashes the file could be in the write caches of the os and it could be lost. In theory the journal should handle such cases, but there is always a chance of total failure.

--- End quote ---
I read that the change journal of NTFS is not able to recover old versions of the file.

The problem is not that the file was ever deleted, it was physically overwritten during the blue screen.

Like I said, my latest commit for that file is like three days old, and I lost a lot of changes since then.


oBFusCATed:

--- Quote from: UberNewb2 on January 11, 2019, 11:29:31 pm ---The problem is not that the file was ever deleted, it was physically overwritten during the blue screen.

--- End quote ---
There are multiple levels of caches, both software and hardware. If the file hasn't been flushed fully to the storage media, there is nothing that would prevent a corruption.

C::B deletes the original with a move operation. So after a successful save there is no trace of the temporary file.

UberNewb2:

--- Quote from: oBFusCATed on January 12, 2019, 12:16:11 am ---
--- Quote from: UberNewb2 on January 11, 2019, 11:29:31 pm ---The problem is not that the file was ever deleted, it was physically overwritten during the blue screen.

--- End quote ---
There are multiple levels of caches, both software and hardware. If the file hasn't been flushed fully to the storage media, there is nothing that would prevent a corruption.

C::B deletes the original with a move operation. So after a successful save there is no trace of the temporary file.

--- End quote ---
Well I'm screwed then. :/ No temporary file to undelete means no back up copy. Dang. I'd honestly prefer you litter my source directory with temporary deleted files then make it as if they never existed. :/

oBFusCATed:

--- Quote from: UberNewb2 on January 12, 2019, 12:56:59 am ---Well I'm screwed then. :/ No temporary file to undelete means no back up copy. Dang. I'd honestly prefer you litter my source directory with temporary deleted files then make it as if they never existed. :/

--- End quote ---
Sorry, we're not making a backup software. For such purposes there are better alternatives (like using git and commit every small change you make every hour or two; this have other benefits which a backup solution won't provide).

You can look at the auto save plugin, it has such features, but very limited.

UberNewb2:
Well the autosave plugin might be what I'm looking for, but I can't tell what it does or where it saves things. The wiki page ;

http://wiki.codeblocks.org/index.php/Autosave_plugin

doesn't say much...

I can tell from the settings in the environment settings that I can make a .save file every X minutes, which works.

That would at least save my butt in the case of another BSOD.

And yes, I'll try to commit more often.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version