[fpc-pascal] Handling recursive symlinks in Linux

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Feb 19 13:33:39 CET 2011


On 19 Feb 2011, at 07:57, brian wrote:

> I'm trying to convert a Delphi console-mode program which needs to walk directory trees to FP **and Linux** - is there a standard way to detect and handle recursive symlinks, if the user has been daft enough to create them?

Many programs handle this by following symlinks only to a certain maximum depth. E.g., they print an error if they have followed 16 or more symlinks already. An alternative is to keep track of every directory you have traversed (or are traversing) already, and to skipping symlinks pointing to such directories.


Jonas


More information about the fpc-pascal mailing list