delphi-strings

TDirectory.GetDirectoryRoot does not handle correctly paths of Max_Path characters

一笑奈何 提交于 2021-01-27 17:51:10
问题 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? 回答1: And this is why: class procedure TDirectory.InternalCheckDirPathParam(const Path: string; const ExistsCheck: Boolean);