Index: src/main/native/port/windows/hyfile.c =================================================================== --- src/main/native/port/windows/hyfile.c (revision 485462) +++ src/main/native/port/windows/hyfile.c (working copy) @@ -330,7 +330,57 @@ I_32 VMCALL hyfile_mkdir (struct HyPortLibrary * portLibrary, const char *path) { - if (CreateDirectory (path, 0)) + char *canonicalpath; + int returnVar=0; + int len = strlen(path); + int i=0; + int j=0; + int k=0; + int founddots=0; + int *slash; + //If the length is longer than 248, unicode format should be used to CreateDirectroy. + //"." and ".." need be processed in the unicode format. + if(len >= 248){ + slash = portLibrary->mem_allocate_memory(portLibrary, len); + canonicalpath = portLibrary->mem_allocate_memory(portLibrary, len+5); + strcpy(canonicalpath,"\\\\?\\"); + + for(i=0,j=4;i0 || path[i-1]=='\\'){ + founddots++; + continue; + } + } + if(path[i]=='\\'){ + if(founddots == 1){ + founddots = 0; + continue; + }else if (founddots > 1){ + if(k-2<0){ + k=2; + } + j=slash[k-2]; + k--; + }else{ + slash[k++]=j; + } + } + canonicalpath[j]=path[i]; + j++; + founddots = 0; + } + + canonicalpath[j]='\0'; + returnVar = CreateDirectory (canonicalpath, 0); + + portLibrary->mem_free_memory(portLibrary, canonicalpath); + portLibrary->mem_free_memory(portLibrary, slash); + }else{ + returnVar = CreateDirectory (path, 0); + } + + if (returnVar) { return 0; }