Getpathtype(cPath) ---> 0 if the path doesn't exists
1 if it corresponds to existing file
2 if it corresponds to existing directory
-1 if the path exists but has
an unknown type (e.g. a pipe)