alphaleonis / AlphaFS

AlphaFS is a .NET library providing more complete Win32 file system functionality to the .NET platform than the standard System.IO classes.
http://alphafs.alphaleonis.com/
MIT License
566 stars 99 forks source link

Relative path from a full path #370

Closed QbProg closed 6 years ago

QbProg commented 6 years ago

Hello, I could not find a way to obtain the relative path of a full path. For instance, Path1 : C:\Windows\Test.txt Path2 : C:\Windows\ something like Path3 = GetRelativePath(Path1,Path2) Path3 = ".\Test.txt"

or Path1 = C:\Windows\System\Test.txt Path2 = C:\Windows\Other\Directory\ Path3 = ..\..\System\Test.txt

Any ideas?

Yomodo commented 6 years ago

Hi, There is no support for that in AlphaFS. Perhaps this link can help you out: Combine and resolve relative paths in C#

QbProg commented 6 years ago

Actually I'd like to do something like this: https://stackoverflow.com/questions/13266756/absolute-to-relative-path

could it be a nice feature addon?