[cs631apue] fts functions
Boxiang Dong
bdong at stevens.edu
Tue Sep 23 16:34:32 EDT 2014
Hi,
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:
A/B/b1
A/B/b2
A/C/c1
A/d1
After applying the fts functions, it will traverse the hierarchy in this
order:
A
A/B
A/B/b1
A/B/b2
A/C
A/C/c1
A/d1
But what we need is actually a BFS traverse algorithm. It means the order
in the example should be:
A
A/B
A/C
A/d1
A/B/b1
A/B/b2
A/C/c1
I have tried a couple of methods to make it BFS, but all failed. Is there
anyone who has some idea about that?
Thanks,
--
Boxiang Dong
Ph.D Candidate
Department of Computer Science
Stevens Institute of Technology
Hoboken, NJ, USA
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20140923/f54f63fa/attachment.html>
More information about the cs631apue
mailing list