<div dir="ltr">Hi,<div><br></div><div>I played the fts functions like fts_open(), fts_read() and fts_children() for a while, and found out that the fts functions go through the file hierarchy in DFS fashion. For example, if I have a dir like this:</div><div><br></div><div><div>A/B/b1</div><div>A/B/b2</div><div>A/C/c1</div><div>A/d1</div></div><div><br></div><div>After applying the fts functions, it will traverse the hierarchy in this order:</div><div><br></div><div>A</div><div>A/B</div><div><div><div>A/B/b1</div><div>A/B/b2</div><div>A/C</div><div>A/C/c1</div><div>A/d1</div></div><div><br></div><div>But what we need is actually a BFS traverse algorithm. It means the order in the example should be:</div><div><br></div><div><div>A</div><div>A/B</div><div><div>A/C</div></div><div><div>A/d1</div></div><div><div>A/B/b1</div><div>A/B/b2</div><div>A/C/c1<br></div><div><br></div></div></div><div><br></div><div>I have tried a couple of methods to make it BFS, but all failed. Is there anyone who has some idea about that?</div><div><br></div><div>Thanks,</div><div>-- <br></div><div dir="ltr">Boxiang Dong<div>Ph.D Candidate</div><div>Department of Computer Science</div><div>Stevens Institute of Technology</div><div>Hoboken, NJ, USA</div></div>
</div></div>