-----------------------------------------------------------------------------
| 878 | |
| 879 | //----------------------------------------------------------------------------- |
| 880 | bool Platform::createPath(const char *file) |
| 881 | { |
| 882 | char pathbuf[MaxPath]; |
| 883 | const char *dir; |
| 884 | pathbuf[0] = 0; |
| 885 | U32 pathLen = 0; |
| 886 | |
| 887 | // all paths should be created in home directory |
| 888 | char prefPathName[MaxPath]; |
| 889 | MungePath(prefPathName, MaxPath, file, GetPrefDir()); |
| 890 | file = prefPathName; |
| 891 | |
| 892 | // does the directory exist already? |
| 893 | if (DirExists(prefPathName, true)) // true means that the path is a filepath |
| 894 | return true; |
| 895 | |
| 896 | while((dir = dStrchr(file, '/')) != NULL) |
| 897 | { |
| 898 | dStrncpy(pathbuf + pathLen, file, dir - file); |
| 899 | pathbuf[pathLen + dir-file] = 0; |
| 900 | bool ret = mkdir(pathbuf, 0700); |
| 901 | pathLen += dir - file; |
| 902 | pathbuf[pathLen++] = '/'; |
| 903 | file = dir + 1; |
| 904 | } |
| 905 | return true; |
| 906 | } |
| 907 | |
| 908 | // JMQ: Platform:cdFileExists in unimplemented |
| 909 | //------------------------------------------------------------------------------ |
nothing calls this directly
no test coverage detected