Core Function GetRelativePath
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> GetRelativePath( <Path1>, <path2> ) </pre> === Description === Try makes a path relative to another. === Parameters === ==== path1 : pathToWhichToMakeRelativeTo ==== T...")
Newer edit →
(Created page with "<pre> GetRelativePath( <Path1>, <path2> ) </pre> === Description === Try makes a path relative to another. === Parameters === ==== path1 : pathToWhichToMakeRelativeTo ==== T...")
Newer edit →
Revision as of 10:59, 18 June 2015
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
With 0 Params
Returns current working directory.
With 1 Param
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