ftw (was Re: Anything faster than stat(S)? ...)

Mike Van Pelt mvp at v7fs1.UUCP
Wed Dec 13 09:08:06 AEST 1989


I just had reason to use ftw in a program, and I thought
I'd pass this little tidbit along.  

For some reason, ftw calls stat, which returns information
on the file pointed to by a symbolic link, rather than
information about the link itself.  Sometimes you may want
to do this, but not (as in my case) when you're trying to
produce a report of disk usage.

The solution:  Supply a function stat which calls lstat.
It will be used by ld instead of the system stat.
-- 
Mike Van Pelt                     "Something is happening here,
Headland Technology/Video 7        What it is ain't exactly clear..."
...ames!vsi1!v7fs1!mvp                 -- Pons & Fleischmann



More information about the Alt.sources mailing list