[Lazarus] CreateRelativePath document error.

Juha Manninen juha.manninen at phnet.fi
Tue Feb 9 09:17:26 CET 2010


Another thing related to CreateRelativePath:

  RelPath:=CreateRelativePath(FileName, BasePath);

Now, when
  BasePath is '/TopDir/Tests/MyProj/'
and
  FileName is '/TopDir/Tests/MyProj/src/MyUnit.pas'
then
  RelPath = 'src/MyUnit.pas'
which is correct.

However if the BasePath is longer (deeper) than FileName's path, it doesn't 
work. For example, when
  BasePath is '/TopDir/Tests/MyProj/src/'
and
  FileName is '/TopDir/Tests/MyProj/MyFile.cfg'
then I want to have
  RelPath = '../MyFile.cfg'  ( <-- note ../ )
but it doesn't happen.

Is there such a function hidden somewhere in FPC/Lazarus vast amount of code?
If not, then CreateRelativePath should be fixed.


Regards,
Juha Manninen




More information about the Lazarus mailing list