IOUtils.TDirectory.GetDirectoryRoot(Folder) gives me an error when 'Folder' is 259 chars long (yes, it includes the \ separator at the end):
Project Tester.exe raised exception class EPathTooLongException with message 'The specified path is too long'.
I though that I can use up to 260 chars in paths.

Why GetDirectoryRoot does not accept paths that are of Max_Path chars?
And this is why:
And this is the user manual for this 'wonderful' function:
Thank you Embarcadeor/Idera for this high quality job!
So,
IOutilscannot be used in conjunction withMax_Path. It usesInternalCheckDirPathParamall over the place!The solution would be to define your own
MaxPathconstant:So, go now do a Ctrl+Shift+F and check all your code :)
Anyway, a conflict remains: a valid path (260 chars) returned by some API call cannot be passed to
IOUtilswhich only accepts 248 chars. If you find a better solution, let me/us know and I will accept your answer :)