Core Function GetRelativePath
From Sputnik Wiki
GetRelativePath( <Path1>, <path2> )
Contents |
Description
Try makes a path relative to another.
Parameters
path1 : pathToWhichToMakeRelativeTo
The path to which to make relative to.
path2 : pathToMakeRelative
The path to make relative.
Return Value
Success: Returns the relative path.
Failure: Returns a copy of the pathToMakeRelative.
Remarks
None
Example
// Path To Which To MakeRelative To my $first = @"c:\folder1\folder2\folder4"; // Path To Make Relative my $second = @"c:\folder1\folder2\folder3\file1.txt"; // Get the relative path my $path = GetRelativePath($first, $second); // Print it say $path; // PRINTS: // ..\folder3\file1.txt