
12 Jun
2007
12 Jun
'07
5:20 a.m.
On 11/06/07, Michael Marcin <mmarcin@method-solutions.com> wrote:
Something like the following would work for me.
is_file_within_directory_tree( "C:\export", "C:\work\anotherfile.txt" ); // returns false is_file_within_directory_tree( "C:\export", "C:\export\blah\myfile.txt" ); // returns true
Is there an easy way to do this with Boost.Filesystem?
Depending what you want, you could do a find for the leaf of the file over a recursive_directory_iterator of the path, or you could see if the iterator range in the path is a prefix of that in the file. ~ Scott McMurray