All code posted here, unless otherwise specified, is licensed under a BSD 2 Clause license. The only note is that these snippets do not have the BSD copyright notice - so you are exempt from including them.
After a client whined a little while from FTP taking too long to remove his enormous mistakes, I decided to take a shot at writing a php program to quickly remove files from the addons directory of his garrysmod server. My main goal in this is to prevent any bugs, and any possibility to remove files outside of the addons directory using things like ".." I thought I'd post to see if there was any flaws or security exploits that should be fixed.
The code looks good. It is pretty solid. The only suggestions I can make that Nate didn't already cover are pretty much opinionated, so here are some of my opinions.
Lets start here...
for( vector<string>::const_iterator i = data.begin(); i != data.end(); i++)
cout<<*i <<' ';
While this works and accomplishes what you want, it is not very readable. Having to dereference a pointer in order to get it's contents is something you should avoid while being a novice IMHO. It causes uneeded congestion and there are simpler w
I think we should have a support section - but I'll let Justin (Celestialkey) figure that out.
A couple of things:
- Many people argue global variables are bad form ie:
- Shelling out to a system command with system is usually frowned upon because it's platform dependent (arguably there are a lot worse C++ code that you will probably write that will be platform dependent) ie
First, does this forum have a help and support section, or is this all for tutorials? I've got my program all finished and it appears to function as I want it to, I just thought I'd post it so that you guys could chime in and maybe tell me what's bad and what there is to change.