When your files get garbled
I have a tiny little web site that I’m beginning to setup — just some basic PHP for now. I need to update some stuff on there and so I fired up Aquamacs on my MacBook and began to edit stuff over Tramp.
And something went horribly, terribly wrong.
I’m not sure what that something was, but my index.php was mostly missing. By “mostly”, I’m saying the beginning of the file was there, and the end of the file was there, but the middle 2/3 were replaced by some binary data. Doing a “file index.php” on it resulted in “index.php: data”, so it was for sure binary data — not something else.
The weirdest thing was that it looked fine in the editor but the browser had the garbled crap in it. So I quit the editor and went back in — and found the garbled text in there.
Naturally, I didn’t have the backup, but it wasn’t hard to rewrite it. This experience makes me scared to try it again — scared enough to do better at backing up, for sure.
