[cs631apue] FTS directories visited twice

Devharsh Trivedi dtrived5 at stevens.edu
Tue Oct 15 13:46:25 EDT 2019


>From manual:

In general,
     directories are visited two distinguishable times; in pre-order (before
     any of their descendants are visited) and in post-order (after all of
     their descendants have been visited).  Files are visited once.  It is
     possible to walk the hierarchy "logically" (ignoring symbolic links) or
     physically (visiting symbolic links), order the walk of the hierarchy or
     prune and/or re-visit portions of the hierarchy.


I have used fts_info attribute for printing once.


On Oct 8, 2019, at 6:45 PM, Zixuan Chen <zchen91 at stevens.edu<mailto:zchen91 at stevens.edu>> wrote:

Hello Professor,
I see that in the FTS description, directories will be visited twice, both in preorder and postorder. Could you tell me the purposes of doing that? And what can we do in order to avoid printing the name of upper directory twice when only listing the content of current working directory?
Thanks.

Best Regards,
Zixuan Chen
_______________________________________________
cs631apue mailing list
cs631apue at lists.stevens.edu<mailto:cs631apue at lists.stevens.edu>
https://lists.stevens.edu/mailman/listinfo/cs631apue

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20191015/2a79e261/attachment-0001.html>


More information about the cs631apue mailing list