22 Jun
2004
22 Jun
'04
8:02 p.m.
BTW, one other caveat (which applies to all of the examples so far): doesDirectoryExist doesn't distinguish between directories and symlinks to directories. Consequently, any directory-traversal algorithm which uses doesDirectoryExist to identify directories will behave incorrectly in the presence of symlinks. In the worst case, you can get into an infinite loop.
symlinks aren't necessary to give an infinite loop: you can have upwards hard links as well (at least on *nix). You have to keep a list of inodes you've already visited (per filesystem, of course). --KW 8-) -- Keith Wansbrough <kw217@cl.cam.ac.uk> http://www.cl.cam.ac.uk/users/kw217/ University of Cambridge Computer Laboratory.