Core Function GetRelativePath

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> GetRelativePath( <Path1>, <path2> ) </pre> === Description === Try makes a path relative to another. === Parameters === ==== path1 : pathToWhichToMakeRelativeTo ==== T...")
 
(Return Value)
 
Line 18: Line 18:
  
 
=== Return Value ===
 
=== Return Value ===
 
==== With 0 Params ====
 
 
Returns current working directory.
 
 
==== With 1 Param ====
 
  
 
Success: Returns the relative path.  
 
Success: Returns the relative path.  
  
Failure: Returns a copy of the pathToMakeRelative.  
+
Failure: Returns a copy of the pathToMakeRelative.
  
 
=== Remarks ===
 
=== Remarks ===

Latest revision as of 11:00, 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

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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox