Email Address: Support@HeuristicResearch.com
One handy and innocent-looking Delphi function in SysUtils is:
Path := ExcludeTrailingBackslash(Path);
It is failsafe when you use it to append a filename after it, like:
FileName := ExcludeTrailingBackSlash(Path) + '\MyFileName';
But if you have a foldername for folder operations WITHOUT appending a filename,
you may get surprise crashes with root-folders.
is a valid folder name, but if you remove the backslash from C:\ then you get
which is not a valid folder name!
So unless you are sure you'll attach a filename with a backslash,
be sure to adjust:
if Copy(Path, Length(Path), 1) = ':' then Path := Path + '\';