views:

84

answers:

1

Hello everyone.

How can I remove the . and .. from a path in Delphi (not using .NET). I need a function, so I can pass it something like 'c:\program files..\program files...', and I want the function to return to me 'c:\'.

Can Delphi do that on its own? Or do I need to do it myself?

+1  A: 

Maybe this is what you are looking for:

SysUtils.ExpandFileName('c:\temp\.\test\..\test2')

It returns the absolute path with all relative parts removed.

Ville Krumlinde
You're right:) Thanks!
Ove