I was developing a website using Dreamweaver, I was editing one of my php files and suddenly the electricity shut down and my computer turned off. when I turned on my PC again and open the file that I was editing, all the contents were gone!!! When I look to the php file size it was 10 KB so that means it is not empty, so i decided to open it in note++ it showed me a long string of nulls !!!

So is there a way to get my file contents back?? Please because I spent almost a week coding it :(

migrated from stackoverflow.com Nov 7 '13 at 15:23

This question came from our site for professional and enthusiast programmers.

  • please make it a habit to save your file after every 10 min.i am afraid you cant recover that. – Rishabh Raj Nov 7 '13 at 5:12
  • do you have backup? – Sumit Bijvani Nov 7 '13 at 5:15
  • It's a good practice to turn your project folder into a Git repository and commit daily (mine do that automatically), this way you not only have a backup but a backup that can be restored back and forward to any situation you need. It's very handy and have saved my bacon several times. – Havenard Nov 7 '13 at 5:18
  • Rishabh Raj I have saved the file, and I was opening the file before without any problems, but this time I don't know what happened!! – user2073081 Nov 7 '13 at 5:19
  • What happened is very simple, your computer shut down when it shouldn't and disk data became inconsistent. Nothing you can do about it. – Havenard Nov 7 '13 at 5:20

It sounds as though the file encoding was corrupted. You can see a similar long list of NULLs if you open an image or an mp3 file inside a text editor.

I don't know how Dreamweaver stores the files it is currently working on, whether they are cached in memory until written to the disk during saves, or whether they are saved in temp files on the disk (like MS Office).

Whatever the case, the file was open and in some sort of transitional state on your drive when your computer crashed. This transitional state is unrecognizable to your system.

This isn't necessarily a problem with Dreamweaver, though there are ways the program could operate that would make the files less prone to this sort of thing (Microsoft Office, for instance, writes just about everything to a temp file that is then dumped to the actual file you're working on, this is what allows it to display a list of "recovered documents" when you start it up after a crash).

Whatever the case, proper backups are always a good idea, and setting your application to auto-save at regular and frequent intervals is always a good idea.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.