2012-11-02

-RRRRRRRRRRRRRRRRRR

(as in, 'aaaaarggghhh!' - but you got that, right?)

So I was working on a web application. I needed to check something I had done in a previous version, so I copied the relevant version of the app to the XAMPP htdocs directory. Something was amiss, however, because the log wouldn't write to the log files. Oh! Duh! Forgot to set the file permissions. So I decided to access the directory and just chmod 777 the entire log directory. So I did this:

chmod -R 777 htdocs/mywebapp/logs/

Except I didn't do that. I got distracted by my boss, and so what I actually did was this:

chmod -R 777 /

Aaaaaaaarrrrgghhhh!!!!!

So in case you don't know, the -R is a flag that causes the command to be carried over to subdirectories and subdirectories of those subdirectories, ad infinitum. Great if your directory just contains a few text files. Not so awesome if you are in the root.

Of course, the OS is not as stupid as I am, so it refused to alter many of the files. But it didn't refuse to alter all of them. XAMPP doesn't like when you alter file permissions randomly. With no way of knowing which files had been altered and what their original permissions were anyway, I just had to give up and reinstall.

The moral: don't get distracted while messing with -R.

Also, don't mess with things you don't understand. Or... well, in this case, don't mess with things you do understand and then get distracted and use them in ways you wouldn't ordinarily and mess everything up.

I blame my boss.

No comments:

Post a Comment