CheckDirExist should now work for files and directories.
Just changed dummy mode_t to int.
still untested.