Assume I have an incomplete path-string: C:\dir\temp\f
And I have the following filesystem:
C:\dir\
c:\dir\temp\
c:\dir\temp\foobar\
c:\dir\temp\foobar2\
c:\dir\temp\bar
I want to determine which part of the directory is the best matching. In this example it would be c:\dir\temp\foobar\
because it starts with the path-string (and foobar
matches better than foobar2
).
how can i efficiently get the available path? Do I have to split up the incomplete path string by /
and test if the folders are available or is there a better method?