Subdirectories
BlitzMax Forums/BlitzMax Programming/Subdirectories
| ||
| How can I know if one path belongs to a subdirectory of another? This seems to be a nontrivial problem. |
| ||
HiSuperStrict
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
EndIfEnjoy |
| ||
| that whole realpath function I did not know it existed very helpful thank you much |