Subdirectories

BlitzMax Forums/BlitzMax Programming/Subdirectories

Pineapple(Posted 2012) [#1]
How can I know if one path belongs to a subdirectory of another? This seems to be a nontrivial problem.


Oddball(Posted 2012) [#2]
Hi

SuperStrict

Global sourcePath:String=RealPath(RequestDir("Select parent dir"))
Global testPath:String=RealPath(RequestDir("Select dir to test"))

If Left(testPath,sourcePath.length)=sourcePath
	Print testPath+" is a subdirectory of "+sourcePath
Else
	Print testPath+" is not a subdirectory of "+sourcePath
EndIf


Enjoy


Pineapple(Posted 2012) [#3]
that whole realpath function

I did not know it existed

very helpful

thank you much