-----------------------------------------------------------------------------
| 854 | |
| 855 | //----------------------------------------------------------------------------- |
| 856 | bool Platform::createPath(const char *file) |
| 857 | { |
| 858 | char pathbuf[MaxPath]; |
| 859 | const char *dir; |
| 860 | pathbuf[0] = 0; |
| 861 | U32 pathLen = 0; |
| 862 | |
| 863 | // all paths should be created in home directory |
| 864 | char prefPathName[MaxPath]; |
| 865 | MungePath(prefPathName, MaxPath, file, GetPrefDir()); |
| 866 | file = prefPathName; |
| 867 | |
| 868 | // does the directory exist already? |
| 869 | if (DirExists(prefPathName, true)) // true means that the path is a filepath |
| 870 | return true; |
| 871 | |
| 872 | while((dir = dStrchr(file, '/')) != NULL) |
| 873 | { |
| 874 | dStrncpy(pathbuf + pathLen, file, dir - file); |
| 875 | pathbuf[pathLen + dir-file] = 0; |
| 876 | bool ret = mkdir(pathbuf, 0700); |
| 877 | pathLen += dir - file; |
| 878 | pathbuf[pathLen++] = '/'; |
| 879 | file = dir + 1; |
| 880 | } |
| 881 | return true; |
| 882 | } |
| 883 | |
| 884 | // JMQ: Platform:cdFileExists in unimplemented |
| 885 | //------------------------------------------------------------------------------ |
nothing calls this directly
no test coverage detected