Add functions to check the validation of the arguments

Fix function dircheck();
Add function ipcheck();
Add function filecheck();
Add function portcheck();
ps. Fix the arguments of getopt.
Merge pull request #8 from lzhang25/master

Add functions to check the validation of the arguments