Converts the specified absolute file pathname to the relative one against the specified context directory.
Parameters:
pathname
'/'
or '\'
.
Note: The passed parameter value is expected to be an absolute file pathname. However, there are two special situations:
contextDir
Note: The passed parameter value is expected to be an absolute pathname. However, if this is a relative pathname, it will be converted to the absolute one against the current system directory.
The allowed name-separator character may be '/'
or '\'
.
asURL
When true
, all name-separator character
in the result relative pathname will be '/'
.
If the result is absolute pathname, it will be converted to a local URL.
When false
, the name-separator character in the result pathname will be system-dependent.
Note: When this parameter is not specified, its default value is false
.
The following call:
makeRelativePath (
"C:\doc\images\diagram.gif",
"C:\doc\package1\package2",
true
)
"../../images/diagram.gif"