Add permission check to datadir
Merge pull request #610 from rimms/check_permission_of_datadir

Add permission check to datadir