Mail Archives: djgpp-workers/2000/08/24/12:35:32
Eli Zaretskii wrote:
> Assuming this indeed is needed, wouldn't it be a better design to have
> a function that resolves one path component at a time? Then you could
> simply call it in a loop, replacing the slash after each part with a
> '\0', and accumulate the full resolved path as you go.
It's the same thing __solve_symlinks() is doing now. It calls readlink() in
a loop, however it assumes that readlink will resolve only the last path
part. And there is nothing wrong with that except perfomance.
I think I've got it: what about making readlink() follow symlinks as advertised,
and leave __internal_readlink() not to follow symlinks, as it does now? Then
simply replace readlink() calls in __solve_symlinks() to __internal_readlink()
calls. If it is OK, then it is five times less work for me to do :)
Laurynas
- Raw text -