0

(Using Delphi 2010)

Is there a simple but stable way to combine absolute and relative filenames, so that the resulting filename is a well-formed filename?

dir1\dir2\dir3\ + ..\filename => dir1\dir2\filename
dir1\dir2\dir3\ + ..\..\filename => dir1\filename
dir1\dir2\dir3\ + .\filename => dir1\dir2\dir3\filename

Path.Combine comes to mind, but it resolves to something like

dir1\dir2\dir3\ + .\filename => dir1\dir2\dir3\.\filename

which does not seem to be a well-formed filename

Thanks a lot! Willem

Willem
  • 61
  • 4

1 Answers1

0

I post this as an answer because I can't flag it as duplicate for some reason.

Check the RelToAbs function here

Community
  • 1
  • 1
Etsitpab Nioliv
  • 354
  • 1
  • 4
  • 15