how to convert a directory path to a relative path to another directory
-
for example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
-
for example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
it is just simple strings game. remove starting part of the path which is identical for both paths, then count number of remaining folders (RF#) in path A. then relative path is "(../) x RF# / remaining part of path B". i'm curious what would you need this for :) sounds like school homeword but it's holiday now :)
rrrado
-
for example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
Use
PathCommonPrefix()
.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
-
for example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
Painted on the side of a dog trainer's van: SIT HAPPENS
-
for example: DirA = "c:\windows\system" DirB = "c:\private\doc" A realtive to B = ..\..\private\doc how to implement this? thanks in advance.
thanks for all you guys :).