"ClrObject static method invocation error"
Es hat eine Weile gedauert aber dann bin
ich auf eine funktionierende Lösung gestoßen.
//
Verifyes or creates Path
static client public boolean createDirectoryPath(FilePath _path)
{
int ptr;
;
_path = strLRTrim(_path);
if (substr(_path,strlen(_path),1) != '\\') // Adding backslash gives a more simple while-loop!
{
_path += '\\';
}
//enables creation of UNC paths, by detecting which folder already exists (backwards).
ptr = strLen(_path);
ptr = strfind(_path, '\\', ptr, -ptr);
while(!WinAPI::folderExists(substr(_path,1,ptr)))
{
ptr = strfind(_path, '\\', ptr -1 , -ptr);
}
while (ptr)
{
WinAPI::createDirectory(substr(_path, 1, ptr));
if (!WinAPI::folderExists(substr(_path, 1, ptr)))
{
break;
}
ptr = strfind(_path, '\\', ptr + 1, strlen(_path));
}
return WinAPI::folderExists(_path);
}
static client public boolean createDirectoryPath(FilePath _path)
{
int ptr;
;
_path = strLRTrim(_path);
if (substr(_path,strlen(_path),1) != '\\') // Adding backslash gives a more simple while-loop!
{
_path += '\\';
}
//enables creation of UNC paths, by detecting which folder already exists (backwards).
ptr = strLen(_path);
ptr = strfind(_path, '\\', ptr, -ptr);
while(!WinAPI::folderExists(substr(_path,1,ptr)))
{
ptr = strfind(_path, '\\', ptr -1 , -ptr);
}
while (ptr)
{
WinAPI::createDirectory(substr(_path, 1, ptr));
if (!WinAPI::folderExists(substr(_path, 1, ptr)))
{
break;
}
ptr = strfind(_path, '\\', ptr + 1, strlen(_path));
}
return WinAPI::folderExists(_path);
}