[fpc-pascal]Detecting (sym)link in fpc/Linux
mirek.novak at auto.cz
Wed Sep 5 16:46:19 CEST 2001
in fpc unit linux there are defined 'POSIX macros' (as said in 'man fstat')
for checking filetype
what U need is 'S_ISLNK()' see units.pdf
Cor Slot píše:
> How can see if a file is a link on a linux filesystem?
> I'm trying to create a routine that recursively scans the filesystem
> with findfirst, findnext, findclose. For each file I use fstat to get
> info about the file.
> When the program encounters a link to a directory it recurses into that
> directory. When the link points to the same directory as the link is in
> this gives an endless loop.
> With the data I have from searchrec and stat, how can I determine that
> the current file is a link? Or do I need another function to do that?
> cslot at xs4all.nl
> Cor.J. Slot Rotterdam [NL]
> Voice/FAXmail +31 84 851 04 78
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 287 bytes
Desc: Vizitka - Mirek Novak
More information about the fpc-pascal